Range.HighlightColorIndex property (Word)

Returns or sets the highlight color for the specified range. Read/write WdColorIndex.

Syntax

expression. HighlightColorIndex

expression Required. A variable that represents a Range object.

Example

This example removes highlight formatting from the selection.

Selection.Range.HighlightColorIndex = wdNoHighlight

This example applies yellow highlighting to each bookmark in the active document.

For Each abookmark In ActiveDocument.Bookmarks 
 abookmark.Range.HighlightColorIndex = wdYellow 
Next abookmark

See also

Range Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.