Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MatchWholeWord Property

Find.MatchWholeWord Property (Word)

True if the find operation locates only entire words and not text that's part of a larger word. Read/write Boolean.

expression .MatchWholeWord

expression An expression that returns a Find object.

Use the Text property of the Find object or the FindText argument with the Execute method to specify the text to be located in a document.

This example clears all formatting from the find and replace criteria before replacing the word "Inc." with "incorporated" throughout the active document.

With ActiveDocument.Content.Find 
 .MatchWholeWord = True 
 .Execute FindText:="Inc.", _ 
 ReplaceWith:="incorporated", Replace:=wdReplaceAll 
End With


Other resources

© 2015 Microsoft