Variables.Add Method 

Returns a Variable object that represents a variable added to a document.

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

Usage

Dim Name As String
Dim Value As Object
Dim returnValue As Variable
Dim variables1 As Variables
returnValue = variables1.Add(Name, Value)

Syntax

Function Add( _
    <InAttribute()> ByVal Name As String, _
    <InAttribute()> Optional ByRef Value As Object _
) As Variable
Variable Add(
    [In] string Name, 
    [In, Optional] ref object Value
);
public: Variable^ Add(
    String^ Name, 
    &Object^ Value
);
public Variable Add(
    /*in*/System.String Name, 
    /*in*/System.Object Value
);
function Add(
     Name : String, 
     Value : Object
) : Variable;

Parameters

  • Name
    Required String. The name of the document variable.
  • Value
    Optional Object. The value for the document variable.

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

Variables Interface
Microsoft.Office.Interop.Word Namespace

Other Resources

Variables Members