Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How do I change the value of a document level variable via a JScript Macro?
I found out how to do it via VBScript ie.
function ThresholdSet()
ActiveDocument.Variables("MainCCYear").SetContent "=MainCCDay*22*12",true
end function
But I need to convert it to JScript.
function ThresholdSet() {
var v = ActiveDocument.GetVariable("MainCCYear");
v.SetContent("=MainCCDay*22*12",true);
}
Rgds,
Joachim
function ThresholdSet() {
var v = ActiveDocument.GetVariable("MainCCYear");
v.SetContent("=MainCCDay*22*12",true);
}
Rgds,
Joachim
Thanks, that worked like a charm.
But is there any reason you used a variable, ie. v , as opposed to just doing
ActiveDocument.Variables(
"MainCCYear").SetContent ("=MainCCDay*22*12",true); ?
Best Regards
Dieter
It's just for better readability, and in case you need the object later it's shorter then always having to use "ActiveDocument.GetVariable...."
Rgds,
Joachim