Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I created a certain variable in QV Variable overview tool and now I would like to use it in a VBA script I run with the push of a button.
The only thing i do not know how to do is get the variable value in VBA.
The name of my variable is "mensal"
My VBA code is:
SUB GetSelectedValues()
' set export = ActiveDocument.Variables("mensal")
If export = "0" then
MsgBox "aaa"
Else
MsgBox "bbb"
End If
END SUB
But with this code I get a problem on the IF.
Can anyone help?
Thank you in advance.
Ivo Marques
SUB GetSelectedValues
export =ActiveDocument.GetVariable("mensal").GetContent.String
If export = "0" then
MsgBox "aaa"
Else
MsgBox "bbb"
End If
END SUB
Thanks
BKC
SUB GetSelectedValues
export =ActiveDocument.GetVariable("mensal").GetContent.String
If export = "0" then
MsgBox "aaa"
Else
MsgBox "bbb"
End If
END SUB
Thanks
BKC
Hi Ivo
export = ActiveDocument.Variables("mensal").GetContent.String
should work for you
Joe
It works.
Thank you guys