Jump to content

Is there a way to script the color of a word?


stann
 Share

This topic is 6554 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hello

I would like to change the color of a word in a field because the field contains a specific word.

So If I have a field called "color"

and the word ORANGE is in the field, I would like the text to become orange. and if the word BLUE is in the field, I would like the text to become BLUE. Is there any way to do this?

Thanks

STAN

Link to comment
Share on other sites

2 methods I've used for conditional text formatting:

Have as many text calculation fields as their are possibilities, i.e. TextBlue=If PatternCount (Text, "Blue"), Text, "

TextOrange=If PatternCount (Text, "Orange"), Text, ""

etc.

Then you lay every one of those text calculations over each other, each one specifically formatted with the appropriate text color. It works because all other calculations are empty except the one you want with the appropriate formatting. The only problem would be if both the words "Orange" and "Blue" appear in the text.

A simpler way to do it is to have container calculation under the text. This works more like highlighting rather than text color. You have a repeating global container with each color in a repetition. On the layout, your calculation container is under the text. The calculation would be Case(PatternCount(Text, Blue), globalColor(Repetition 1), PatternCount (Text, Orange), globalColor(Repetion 2), etc.

Link to comment
Share on other sites

This topic is 6554 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.