Function TWPRTFDataBlockEd.MergeText(SenderForCallBack:TObject; CallBack:TWPMailMergeGetTextEvent; Readonly:Boolean; FieldName:string; FieldCommand:string; StartPar:TParagraph; LastPar:TParagraph; ContentsClass:TWPMMInsertTextContentsClass; MergeObjType:TWPTextObjType; Options:TWPMergeTextOptions; CheckField:TWPMailMergeUseFieldCallback) : Boolean
Unit: WPRTEEdit
Class: WPRTEEdit.TWPRTFDataBlockEd
Parameters
-
SenderForCallBack:TObject CallBack:TWPMailMergeGetTextEvent Readonly:Boolean FieldName:string FieldCommand:string StartPar:TParagraph LastPar:TParagraph ContentsClass:TWPMMInsertTextContentsClass MergeObjType:TWPTextObjType Options:TWPMergeTextOptions CheckField:TWPMailMergeUseFieldCallback
Returns
The type of the result value is Boolean.
Description
Start the mailmerge process.The Mailmerge procedure in WPTools modifies the cursor position and the selection to do the text replacement. This makes the mailmerge probably a little slower than the process in WPTools 4 but provides far more options since during the mailmerge procedure the text insertion and character attribute change procedures can be used.
The MergeText function can also be used to read the contents of all fields. If a FieldName is provided only fields with this name will be used. This makes it possible to merge fields which are inside other merge fields which are invisible otherwise! FieldName may contain a * as wildcard.