G
Guest
The Add method for the Document Variables collection is defined more or less
as follows:
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.
Since Value is a variant, I supposed that I could add a collection to the
variables collection, yet I'm getting a "Type Mismatch" error.
Example code is:
Dim oColl As New Collection
oColl.Add Item:=1, Key:="1"
oColl.Add Item:=2, Key:="2"
ActiveDocument.Variables.Add Name:="oColl", value:=oColl
Can someone help me understand where I'm going wrong?
Thank you.
as follows:
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.
Since Value is a variant, I supposed that I could add a collection to the
variables collection, yet I'm getting a "Type Mismatch" error.
Example code is:
Dim oColl As New Collection
oColl.Add Item:=1, Key:="1"
oColl.Add Item:=2, Key:="2"
ActiveDocument.Variables.Add Name:="oColl", value:=oColl
Can someone help me understand where I'm going wrong?
Thank you.