MailMergeFields.AddSet Method
Word Developer Reference |
Adds a SET field to a mail merge main document. Returns a MailMergeField object.
Syntax
expression.AddSet(Range, Name, ValueText, ValueAutoText)
expression Required. A variable that represents a MailMergeFields collection.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
Range | Required | Range object | The location for the SET field. |
Name | Required | String | The bookmark name that ValueText is assigned to. |
ValueText | Optional | Variant | The text associated with the bookmark specified by the Name argument. |
ValueAutoText | Optional | Variant | The AutoText entry that includes text associated with the bookmark specified by the Name argument. If this argument is specified, ValueText is ignored. |
Return Value
MailMergeField
Remarks
A SET field defines the text of the specified bookmark.
Example
This example adds a SET field at the beginning of the active document and then adds a REF field to display the text after the selection.
Visual Basic for Applications |
---|
|
See Also