Re: Coloring texts

Why do you have a loop?

The point of using the setCharaterAttributes is to set the attributes for different characters in the the Document. You are attempting to set the first 5 characters to RED and the the next 2 characters to GREEN. There is no need to do this 3 times.