MailMergeFields.Add Method 

Returns a MailMergeField object that represents a mail merge field added to the data source document.

Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in microsoft.office.interop.word.dll)

Usage

Dim Range As Range
Dim Name As String
Dim returnValue As MailMergeField
Dim mailMergeFields1 As MailMergeFields
returnValue = mailMergeFields1.Add(Range, Name)

Syntax

Function Add( _
    <InAttribute()> ByVal Range As Range, _
    <InAttribute()> ByVal Name As String _
) As MailMergeField
MailMergeField Add(
    [In] Range Range, 
    [In] string Name
);
public: MailMergeField^ Add(
    Range^ Range, 
    String^ Name
);
public MailMergeField Add(
    /*in*/Range Range, 
    /*in*/System.String Name
);
function Add(
     Range : Range, 
     Name : String
) : MailMergeField;

Parameters

  • Range
    Required Range object. The range where you want the field to appear. This field replaces the range, if the range isn't collapsed.
  • Name
    Required String. The name of the field.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

See Also

Reference

MailMergeFields Interface
Microsoft.Office.Interop.Word Namespace

Other Resources

MailMergeFields Members