Beiträge von Paul Brace

    The problem is that the original RTF Object is invalid while merge is called and hence these calls do not appear to be available. It was the absolute position in the text I was after not the screen position. But not to worry I have just finished coding a work around by creating an array with the start positions of all merge fields before calling MergeText and then adjusting subsequent start positions for the length of the text inserted - now working as I need it.

    Thanks for your help.

    Paul

    Julian,

    Thanks for that. I have the PRO version and have exposed the variables as properties (MergeLine and MergePosition, and can access them. However I still have a problem :( .

    I need to get the absolute position of the field in the document and this gives me the postion in the paragraph, the line and the position in line. I therefore have tried a number of ways of calculating the absolute position and drawn a blank. The initial function I called was from the original WP object:

    Txt: TWPRichText;

    Txt.GetPositionOfParLin(Contents.pMergePar,
    Contents.MergeLine,
    Contents.MergePosition);

    This returns -1. It appears that the calling WP object does not contain valid data while in the process of merging the text.

    Any thoughts on how I can obtain the absolute position from these?

    Thanks
    Paul

    Is there any way of determining the character position of the field being evaluated in the event OnGetMailMergeText?

    I need to store additional data that is held independently of the text document but points to the start of the position the text was inserted.

    I have tried to search for the text held in Contents.OldText but it appears this is removed from the RTF before the call. It also appears that CPPosition does not point to the location as I also tried using this.

    Any help would be gratefully received.

    Always the way you search for a bit then ask the question to 10 minutes later discover the answer yourself.

    Looking at my downloads I realised I had the source for the RTF engine which I had never unzipped. Had a quick look at this and it became clear it was in the Header options and that the backups are suppressed by including soDontRenameToBAKFile.

    Hope I did not waste anyones time.

    Paul

    I am using version 4 and in one of my projects WPTools is creating automatic incremented backups whenever a call is made to SaveToFile(), in the form .BAK1, .BAK2 etc. I cannot see any properties that allow me to turn this off and the only reference to BAK files in the help file is to TStoreOptions, but there is no indication where these are accessed from.

    I would appreciate any assistance you can give in helping me to stop these files being created.

    Paul Brace