Start the data merging process fo all or a group of fields.
Applies to
Declaration
void MergeText([In] string FieldName);
Description
Start the data merging process. The event OnFieldGetText will be triggered for each mail merge field.
Mail merge fields can be inserted using IWPTextCursor.InputField(string Name,string Text,bool CursorWithin).
When you need to create a large document from a letter processed by MergeText for all rows in a RecordSet, i.e. to do mass mailing, use the method Memo2.AppendOtherText. Please initialize TextDynamic in the double editor mode, using SetEditorMode(1,...).
If you need to create tables with the contents of a complete RecordSet you can consider to use the internal reporting engine.
The field markers << and >> are usually visible. To hide them use
WPDLLInt1.SpecialTextAttr(wpInsertpoints).Hidden = True
Note |
TextDynamic uses standard RTF tags to load and save fields so merge fields inserted in Word are usually available in TextDynamic as well (without the extended attributes). Alternatively you can inserted the tags using escape text, i.e. <name> and use the method IWPTextCursor.FieldsFromTokens(StartText,EndText,FieldPreText) to convert the text into merge fields. |
Parameters |
Name |
The name of the fields to be merged. You can use the wildcard * to process a group of fields, i.e. MergeText("CustomerDB.*"). |
Please also see Category Mailmerge and the "Mail merge API introduction".