MailMergeDataField.AddToRecipientFields Method
Publisher Developer Reference |
Adds the parent MailMergeDataField object from a particular data source to the master data source (collection of data fields) for a mail-merge publication.
Version Information
Version Added: Publisher 2007
Syntax
expression.AddToRecipientFields
expression A variable that represents a MailMergeDataField object.
Remarks
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.
Example
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 |
---|
|
See Also