Highlight Property Example

This example finds all instances of highlighted text in the active document and removes the highlight formatting by setting the Highlight property of the Replacement object to False.

Set myRange = ActiveDocument.Range(Start:=0, End:=0)
With myRange.Find
    .ClearFormatting
    .Highlight = True
    With .Replacement
        .ClearFormatting
        .Highlight = False
    End With
    .Execute Replace:=wdReplaceAll, Forward:=True, FindText:="", _
         ReplaceWith:="", Format:=True
End With

This example applies highlight formatting to the next instance of bold text in the active document.

With Selection.Find
    .ClearFormatting
    .Font.Bold = True
    With .Replacement
        .ClearFormatting
        .Highlight = True
    End With
    .Execute Forward:=True, FindText:="", ReplaceWith:="", _
        Format:=True
End With