Compartilhar via


Variable.Index Property

Word Developer Reference

Returns a Long that represents the ordinal position of a variable with in the collection of variables. Read-only.

Syntax

expression.Index

expression   Required. A variable that represents a Variable object.

Example

This example adds a document variable to the active document and then returns the position of the specified variable in the Variables collection.

Visual Basic for Applications
  Set myVar = ActiveDocument.Variables.Add(Name:="Name", _
    Value:="Joe")
num = myVar.Index

See Also