MailMergeFields Collection Object
Word Developer Reference |
A collection of MailMergeField objects that represent the mail merge related fields in a document.
Remarks
Use the Fields property to return the MailMergeFields collection. The following example adds an ASK field after the last mail merge field in the active document.
Visual Basic for Applications |
---|
|
Use the Add method to add a merge field to the MailMergeFields collection. The following example replaces the selection with a MiddleInitial merge field.
Visual Basic for Applications |
---|
|
Use Fields(Index), where Index is the index number, to return a single MailMergeField object. The following example displays the field code of the first mail merge field in the active document.
Visual Basic for Applications |
---|
|
The MailMergeFields collection has additional methods, such as AddAsk and AddFillIn, for adding fields related to a mail merge operation.
See Also