Export (0) Print
Expand All

Find.Highlight Property (Word)

Published: July 16, 2012

True if highlight formatting is included in the find criteria. Read/write Long.

expression .Highlight

expression A variable that represents a Find object.

The Highlight property can return or be set to True, False, or wdUndefined. The wdUndefined value can be used with the Find object to ignore the state of highlight formatting in the selection or range that is searched.

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

Community Additions

ADD
Show:
© 2014 Microsoft