Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How to refer to a value of a variable set in one macro in another macro?
You can set the content of the QV variable in one macro and then get the content of the same QV variable in the other macro. Look in the API Guide for functions to handle variables.
Regards.
You can set the content of the QV variable in one macro and then get the content of the same QV variable in the other macro. Look in the API Guide for functions to handle variables.
Regards.
Hi,
If the variable is document-wise (defined in either the script or the variable overview panel in the Settings menu, the following should work
Sub ReadVariable '' reads one variable Set v = ActiveDocument.Variables("vName") MsgBox(v.GetContent.String) '' this displays a message with the contents of vName variableEnd Sub Sub WriteVariable '' stores something into the variable Set v = ActiveDocument.Variables("vName") v.SetContent "New Value", true '' this stores "New Value" into variable vNameEnd Sub
Hope that helps.
Thx