MailMergeFields.AddSet Method

Adds a SET field to a mail merge main document. Returns a MailMergeField object.

Namespace:  Microsoft.Office.Interop.Word
Assembly:  Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)

Syntax

'Declaration
Function AddSet ( _
    Range As Range, _
    Name As String, _
    ByRef ValueText As Object, _
    ByRef ValueAutoText As Object _
) As MailMergeField
'Usage
Dim instance As MailMergeFields
Dim Range As Range
Dim Name As String
Dim ValueText As Object
Dim ValueAutoText As Object
Dim returnValue As MailMergeField

returnValue = instance.AddSet(Range, Name, _
    ValueText, ValueAutoText)
MailMergeField AddSet(
    Range Range,
    string Name,
    ref Object ValueText,
    ref Object ValueAutoText
)

Parameters

  • Name
    Type: System.String
    Required String. The bookmark name that ValueText is assigned to.
  • ValueText
    Type: System.Object%
    Optional Object. The text associated with the bookmark specified by the Name argument.
  • ValueAutoText
    Type: System.Object%
    Optional Object. 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

Type: Microsoft.Office.Interop.Word.MailMergeField

Remarks

A SET field defines the text of the specified bookmark.

See Also

Reference

MailMergeFields Interface

MailMergeFields Members

Microsoft.Office.Interop.Word Namespace