If the Selection is an insertion point, then the document is searched.
When you use a Selection object to find text, any search criteria you specify are applied only against currently selected text.
For more information, see Features available by Office application and project type. Use a Find object to loop through a Microsoft Office Word document and search for specific text, formatting, or style, and use the Replacement property to replace any of the items found.Īpplies to: The information in this topic applies to document-level projects and VSTO Add-in projects for Word. The replace command is an extension of the find command. The Find object is a member of both the Selection and the Range objects, and you can use either one to search for text in Microsoft Office Word documents.