|Publisher Developer Reference|
Version Added: Publisher 2007
expression A variable that represents a MailMergeDataField object.
This method works only if the parent MailMergeDataField object has not already been mapped to a recipient field. You can use the IsMapped property of the MailMergeDataField object to determine if the object has already been mapped.
The following Microsoft Visual Basic for Applications (VBA) macro shows how to use the AddToRecipientFields method to add a data field (column) in a particular data source to the master data source (combined recipient list) for the publication.
Before running this macro, replace datasourceindex with the index number of a valid data source in the data source collection of the active document, and replace fieldname with the name of the field in the data source that you want to add to the combined list of recipient fields.
See the Item method topic for an example of how you can use the Name property of the DataSource object to determine the index number of the data source you want.
|Visual Basic for Applications|