Edytuj

Udostępnij za pośrednictwem


Variables Interface

Definition

A collection of Variable objects that represent the variables added to a document or template. Document variables are used to preserve macro settings in between macro sessions.

public interface class Variables : System::Collections::IEnumerable
[System.Runtime.InteropServices.Guid("00020965-0000-0000-C000-000000000046")]
public interface Variables : System.Collections.IEnumerable
type Variables = interface
    interface IEnumerable
Public Interface Variables
Implements IEnumerable
Attributes
Implements

Remarks

Use the Variables property to return the Variables collection.

Use the Add(String, Object) method to add a variable to a document.

If you try to add a document variable with a name that already exists in the Variables collection, an error occurs. To avoid this error, you can enumerate the collection before adding any new variables.

Use Variables(index), where index is the document variable name or the index number, to return a single Variable object.

The index number represents the position of the document variable in the Variables collection. The first variable added to the Variables collection is index number 1; the second variable added to the collection is index number 2, and so on.

To add a variable to a template, open the template as a document by using the OpenAsDocument() method.

Properties

Application

Returns a Application object that represents the Microsoft Word application.

Count

Returns the number of items in the specified collection.

Creator

Returns a 32-bit integer that indicates the application in which the specified object was created.

Item[Object]

Returns an individual object in a collection.

Parent

Returns an object that represents the parent object of the specified object.

Methods

Add(String, Object)

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

GetEnumerator()

Applies to