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);
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