Syntax
CharColor Color
CharColor()
Remarks
The CharColor statement sets the character color of the selection to the specified color, where Color is one of the following numeric codes.
Color | Explanation | |
0 (zero) | Auto | |
1 | Black | |
2 | Blue | |
3 | Cyan | |
4 | Green | |
5 | Magenta | |
6 | Red | |
7 | Yellow | |
8 | White | |
9 | Dark Blue | |
10 | Dark Cyan | |
11 | Dark Green | |
12 | Dark Magenta | |
13 | Dark Red | |
14 | Dark Yellow | |
15 | Dark Gray | |
16 | Light Gray |
The CharColor() function returns the same number codes set by the CharColor statement or –1 if all the selected text is not the same color.
Example
This example selects the current paragraph (using the predefined bookmark "\ Para") and applies magenta character color formatting if it contains the string "Comments: ".
EditGoTo "\Para" If InStr(Selection$(), "Comments: ") Then CharColor 5
See Also
FormatFont, SelectCurColor