Hmmm I'm unsure then, do you have to do this with HTML?
You could create 3 separate formulas, 1 for each of the following;
string before search criteria
search criteria
string after search criteria
You could then place all 3 of these fields into a text box and put a colour only on the Search critera field.
Regards,
Ryan.
Create 3 formulas, left, mid, right, place the following code in each of them changing r1, r2 & r3 as necassary;
stringvar search:= "test";
stringvar text:= "123test4567";
numbervar ls:= len(search);
numbervar lt:= len(text);
numbervar p:= instr(text,search,1);
numbervar pa:= if p-1 < 0 then 0 else p-1;
stringvar r1:= if p = 0 then text else left(text,pa);
stringvar r2:= if p = 0 then "" else search;
stringvar r3:= if p = 0 then "" else right(text,lt-ls-pa);
r1
Now place left, mid & right into one text box adding your search highlight to the mid field.
Regards,
Ryan.
Edited by rkrowland - 15 Jun 2012 at 5:55am