Table of contents
TOC
Collapse the table of content
Expand the table of content

MailMergeDataField Object (Publisher)

office 365 dev account|Last Updated: 8/24/2017
|
3 Contributors

Represents a single merge field in a data source. The MailMergeDataField object is a member of the MailMergeDataFields collection. The MailMergeDataFields collection includes all the data fields in a mail merge or catalog merge data source (for example, Name, Address, and City).

Remarks

You cannot add fields to the MailMergeDataFields collection. All data fields in a data source are automatically included in the MailMergeDataFields collection.

Example

Use DataFields (index), where index is the data field name or index number, to return a single MailMergeDataField object. The index number represents the position of the data field in the mail merge data source. This example retrieves the name of the first field and value of the first record of the FirstName field in the data source attached to the active publication.

Sub GetDataFromSource() 
 With ActiveDocument.MailMerge.DataSource 
 MsgBox "Field Name: " & .DataFields.Item(1).Name & _ 
 "Value: " & .DataFields.Item("FirstName").Value 
 End With 
End Sub

Methods

Name
AddToRecipientFields
Insert
MapToRecipientField
UnMapRecipientField

Properties

Name
Application
Creator
FieldType
Index
IsMapped
MappedTo
Name
Parent
Value
© 2017 Microsoft