Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
Can somebody help me how to program an On/Off button, that controlls a varialbe if it is on or off (0 or 1)?
best regards,
Attila
Hello Attila,
Hope this piece of code will do
Sub OnOff set var = ActiveDocument.Variables("vIsOnOff") set vButtonLabel = ActiveDocument.Variables("vButtonName") val = var.GetContent.String if val = 0 then vButtonLabel.SetContent "Switch Off", true var.SetContent 1, true else vButtonLabel.SetContent "Switch On", true var.SetContent 0, true end ifEnd Sub
Regards.
Please check this. Let me know.
Thanks.