Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a button that toggels a variable to 1 or 2 that is used in some set analysis expressions. I need to change to backround color of the button depending on whether the variable is a 1 or a 2. I am also changing the text. All is working but I can't find the key word(s) needed to change to backround color. Help!
Thanks,
Stephen
Hi,
Do you have any sample if so please share t me.
Regards,
Anand
Hi,
If you have any sample please share it want to know how you toggle a variable value.
Regards,
Anand
See Code Below (vSoloConsolidated is a variable).
Stephen
Sub ButtonToggle
set v = ActiveDocument.Variables("vSoloConsolidated")
set Button = ActiveDocument.GetSheetObject("BU84")
set Prop = Button.GetProperties
if(v.GetContent.String)= "1" then
set v = ActiveDocument.Variables("vSoloConsolidated")
v.SetContent "2", True
Prop.Text.v = "Button Text 2"
Button.SetProperties Prop
else
set v = ActiveDocument.Variables("vSoloConsolidated")
v.SetContent "1", True
Prop.Text.v = "Button Text 1"
Button.SetProperties Prop
end if
end sub
Figured it out
Prop.BkgColor.PrimaryCol.Col = RGB(12,57,255)
FYI. Use:
ActiveDocument.GetSheetObject( "CH01" ).WriteXmlPropertiesFile "C:\MychartProp.xml"
to see all of the properties of an object. This is very helpfull to find the code that is need.
Stephen