Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
sub StocksActivate
set f=ActiveDocument.Fields("inv")
set sv=f.GetSelectedValues
f.Select "(25|30|43)"
end sub
sub StocksDeactivate
set f=ActiveDocument.Fields("inv")
f.SelectValues sv
end sub
I create two subs for Page Triggers (first to Activate, second to Deactivate trigger). Main idea was to store current selection before activating page to sv variable, and restore it after deactivation. In sub Deactivate a get an error - "Type mismatch: 'f.SelectValues'"
Any ideas?
Is sv declared as a global VB variable? From what you posted, it will be set in StocksActivate but not available to StocksDeactivate.
You can add the following code to your macro to access the content of a variable in the qv document.
rem ** Get setting of variable **
set vT = ActiveDocument.GetVariable("vTest")
rem ** Get value of variable **
SelValue = vT.GetContent.String
rem ** Select data **
ActiveDocument.Fields("inv").Select SelValue
Hi I really appreciate the tip.
For days trying how to read varaibles within a macro.
Thanks