Replacement.Highlight property (Word)

True if highlight formatting is applied to the replacement text. Read/write Long.

Syntax

expression. Highlight

expression A variable that represents a 'Replacement' object.

Remarks

Can return or be set to True, False, or wdUndefined.

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.

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

See also

Replacement 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.