Font.ColorIndex Property

Word Developer Reference

Returns or sets a WdColorIndex constant that represents the color for the specified font. Read/write .

Syntax

expression.ColorIndex

expression   Required. A variable that represents a Font object.

Remarks

The wdByAuthor constant is not a valid color for fonts.

Example

This example changes the color of the text in the first paragraph in the active document.

Visual Basic for Applications
  ActiveDocument.Paragraphs(1).Range.Font.ColorIndex = wdGreen

This example formats the selected text to appear in red.

Visual Basic for Applications
  Selection.Font.ColorIndex = wdRed

See Also