Add Method (Variables Collection)

See Also         Example         Applies To

Adds a variable to a document.

Syntax

expression.Add(Name, Value)

expression   Required. An expression that returns a Variables object.

Name   Required String. The name of the document variable.

Value   Optional Variant. The value for the document variable.

Remarks

Document variables are invisible to the user unless a DOCVARIABLE field is inserted with the appropriate variable name. If you try to add a 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 a new variable to it.