Jump to content

Change colour of specific text


Kingsfield

Recommended Posts

Hi, I have a spreadsheet that contains requests for Cat and Dog samples. Can I create a script that highlight the cat samples requests in RED, and the Dog request in Black. Note that both pet types are in both columns.

see attached file, Hope this makes sense.

Regards

Neill http://forums.printable.com/images/smilies/smile.gif

Website request system 1.csv.1.zip

Link to comment
Share on other sites

The way to change the color of text is with a <color> tag. Please see the FusionPro Tags Reference Guide for more information.

 

In your case, I think you want to do something like this:

 
var fieldval = NormalizeEntities(Field("Sample 1 For Export")); // "Cat:Duck Adult"
var parts = fieldval.split(":");
if (parts.length < 2)
 return fieldval;

var format = "";
if (ToLower(parts[0]) == "cat")
   format = "<color name=Red>"; 

return format + parts[1];

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...