MailMergeFields.AddSet(Range, String, Object, Object) Method

Definition

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

public Microsoft.Office.Interop.Word.MailMergeField AddSet (Microsoft.Office.Interop.Word.Range Range, string Name, ref object ValueText, ref object ValueAutoText);
abstract member AddSet : Microsoft.Office.Interop.Word.Range * string * obj * obj -> Microsoft.Office.Interop.Word.MailMergeField
Public Function AddSet (Range As Range, Name As String, Optional ByRef ValueText As Object, Optional ByRef ValueAutoText As Object) As MailMergeField

Parameters

Range
Range

Required Range object. The location for the SET field.

Name
String

Required String. The bookmark name that ValueText is assigned to.

ValueText
Object

Optional Object. The text associated with the bookmark specified by the Name argument.

ValueAutoText
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.

Returns

Remarks

A SET field defines the text of the specified bookmark.

Applies to