Mailmerge Category

[Top]  [Chapter]  [Previous]  [Next]

Update and read out data fields in the text

Description

The mailmerge process offered by RTF2PDF is one of its most popular features. It can replace the contents of merge fields with formatted text or read out the text in case the user has edited it. This works since the mail merge is not destructive, the field will not be replaced like a Search&Replace would do, but only the data within the field is. Like hyperlinks merge fields use paired objects. One object marks the start of the field, the other the end. The text within is the "embedded text". You can customize the component to show or hide the fieldmarkers (SpecialTextAttr(wpInsertpoints).Hidden). It is also possible to display a single object only which shows the name of the field. (property IWPEditor.ShowFields)

 

The merge process is started with IWPEditor.MergeText(""). You need to create an event handler for OnFieldGetText to insert the data into the field.

 

Properties

 

The event OnFieldGetText receives a reference to IWPFieldContents which contains many properties.


Methods

 

Note: The field markers << and >> are usually visible. To hide the markers use

Memo.SpecialTextAttr(wpInsertpoints).Hidden = True

 


[idh_cat_mailmerge.htm]    Copyright © 2007 by WPCubed GmbH