Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

macro:variable

Hello at ALL,

I would to know why this WV example doesn't work.

------------------------------------------
sub var

set a= ActiveDocument.Variables("Variable1")
a.SetContent "123",true

end sub

------------------------------------------

returns an error..

Thanks

Best Regards,

Slash

4 Replies
biester
Specialist
Specialist

Hi,

have you already added Variable1 (eg in Variable overview)?

Rgds,
Joachim

Not applicable
Author

Hi,

No I have not. Why= first I have to create a variable called "a" and after I have to add and test the API script?

Thanks

Best Regards,

Slash

biester
Specialist
Specialist

Yo have to create "Variable1" first, not "a". "a" is only the object reference in VBscript to this "Variable1". If "Variable1" does not exist, then the object "a" cannot be instantiated, thus the macro fails.

Rgds,
Joachim

Not applicable
Author

Ok, now the variables works..

Thans

Best Regards

Ciao

Slash