Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey,
When I tried to do this:
temp = ActiveDocument.Variables("vTemp").GetContent.String
path = Replace(path, "{1}", temp)
And I get nothing.
When I declare the variable in the module like this, it works :
temp = "temp"
path = Replace(path, "{1}", temp)
The "vTemp" variable declared in the Variable Overview.
What is the problem?
Thanks.
Are you calling the macro from the script or from the UI?
-Rob
Hi,
It is not suggested to use macros if you can achieve the same without using the macros. Always try to avoid macros, some doesn't works in Ajax mode.
Anyway to achieve your requirement use below macro
SUB setVariable()
set v = ActiveDocument.GetVariable("vTemp")
vTempValue = v.GetContent.String
set v = ActiveDocument.GetVariable("path")
v.SetContent Replace(v.GetContent.String, "{1}", vTempValue), true
END SUB
Hope this helps you.
Regards,
Jagan.