September 26, 200916 yr Is there a way to change the color of an object (a button in particular) in a script?
September 26, 200916 yr This, using a merge field as label, changes the button color and the button label. ( and the script has only one step, not needing the refresh ) ButtonColor_Label.zip
January 7, 201016 yr Newbies I see how you set up the script to toggle between the default and fill colors. Is it possible to assign a specific color (hex?) in the script. For example if I want the button background to be able to be set to multiple colors, I want to be able to tell it specifically which one it should change to (instead of toggling between two). Thanks! - Garrett
January 8, 201016 yr You can set up multiple conditions Under a Conditional Formatting for an object... So set up one for each color you want and then make the Formula choose which to display. Let's say you want Red, Green and Blue, set a variable in your script, call it $$ChangeColor (or whatever), that you set to be the color you want through the script... Then your Formula under Conditional Formatting is set with three (3) conditions / formulas, IF($$ChangeColor = "RED") It runs this condition, IF($$ChangeColor = "BLUE", than this condition, etc. There's probably a more elegant way to do this, but this is how I show different colored words on a manufacturing schedule report as certain criteria change to better highlight - tasks to go ahead (green), Problem hold (Red), DONE (gray-out), etc. As each line of each job goes to a different level or task it makes a large list a lot more readable for differnt users... Hope this helps - the key is setting up your conditions. And if you want to duplicate the same Conditions list without having to retype, duplicate the object (word, or field) and then change it - this will keep the attributes of the condition for the new/next field. Format painter may work also but I don't know... Kind regards, Royce
January 14, 201016 yr Newbies I appreciate the help and I think I am following your conditional logic. I actually have an even more basic question in terms of setting the color. I cannot figure out how to write the syntax to actually change this to "Red" for example. I have a script that currently has: Name: $$overdueBkgd (for example) Value: Abs ($$overdueBkgd- 1) This is the way it was originally set up earlier in the sample from this thread. I tried replacing the "1" with "Red" to no avail. How do I change this to a specific color. In my case I was trying to get it to set itself to the lightest gray in the color palette. Thank you for your help! - Garrett
Create an account or sign in to comment