Where is "insertpointlist" in V5 ?

    • Offizieller Beitrag

    Q: Where is "insertpointlist" in V5 ? I use to modify the content programmatically ( i was adding parameters after the fieldname to be merged)

    A: WPTools 5 does not use 'insertpoints' as previous versions. In fact mailmerge is done using true fields. Such fields are represented by a pair of objects (WPTextObj class) which wrap the field text. The property 'Name' of the first object (=StartTag) is used to to idnentify the field name. The property 'Source' contains the optional part of the field specification, I assume your parameters have been put there by the RTF reader.

    You have access to that start tag in the OnMailMergeGetText event using the property Contents.StartInspObject and EndInspObject. (Do not mix up with Contents.CurrentTxtObject - that is the first object INSIDE the field, typically an image)

    You can get a list of all the field start object using the method FieldGetList. That fills a list of the class TWPTextObjList. Optionally you can search in all parts (header/footer, too) or select the fields by the start characters of their name (case sensitively):

    FieldGetList(list, true, 'MASTER.') select all fields which start with 'MASTER.'.

    So, once you have that list you can llop through all objects and modify Name and Objects according to your needs. You can even read and assign the property 'EmbeddedText' which is the text of the field.