There are two ways to do this. You can use Font.ColorIndex
for simple choices or Font.Fill.ForeColor
for more choices. Here are some VBAs:
Sub ChangeColorThisWay() Dim s As Range: Set s = Selection.Range s.Font.Fill.ForeColor = WdColor.wdColorRed End Sub Sub ChangeColorThatWay() Dim s As Range: Set s = Selection.Range s.Font.ColorIndex = WdColorIndex.wdBrightGreen End Sub
Note on Font.Fill.ForeColor
, you also have access to the RGB
property and can set the font to any inconsistent color, for example, s.Font.Fill.ForeColor.RGB = RGB(255, 255, 0)
sets it to yellow.
source share