Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone.
In attached file I have macro. This macro needs to be used with button "Continue" at the firtst tab. Now, when I push this button it is expected that the second tab will be open and value "4" will be selected in the list box. But instead of it, when I press the button, no value has selected.
There is some mistake in code but I don't get where?
Script:
LOAD * INLINE [
TOP
2
3
4
5
10
20
];
Macro:
sub select_first
set vvv_var = ActiveDocument.Variables("v_active_select_first")
vvv_varcont = vvv_var.GetContent.String
if vvv_varcont = "1" then
vvv_var.SetContent "0", true
ActiveDocument.Fields("TOP").Select "4"
end If
end sub
By default: v_active_select_first = 0
Hello Nataliia,
you don't need to use a macro for this, you can simply add a second action that will select inside the TOP field. I re-attached your app so you can take a look at it.
Also your macro did not select a value because you check if the content of the variable "v_active_select_first" is set to "1" (it was set to "0"). After manually setting it to "1" (via Variable Overview) your macro works.
Mathias
Hello Nataliia,
you don't need to use a macro for this, you can simply add a second action that will select inside the TOP field. I re-attached your app so you can take a look at it.
Also your macro did not select a value because you check if the content of the variable "v_active_select_first" is set to "1" (it was set to "0"). After manually setting it to "1" (via Variable Overview) your macro works.
Mathias
Oh! You are right, Mathias. It's all about variable state.
Thank you for your explanation and example. It really helps. Everything is clear now.