If the find operation is successful, the range is redefined and bold formatting is applied to the word "blue." With The following example locates the first occurrence of the word "blue" in the active document. If the Find object is accessed from a Range object, the selection is not changed but the Range is redefined when the find criteria is found. FindText:="Hello", _įinding text without changing the selection You can set the individual properties of the Find object or use arguments with the Execute method, as shown in the following example. The Find object includes properties that relate to the options in the Find and Replace dialog box. The following example selects the next occurrence of the word "Hello." If the end of the document is reached before the word "Hello" is found, the search is stopped. If the Find object is accessed from the Selection object, the selection is changed when the find criteria is found. The find action differs slightly depending upon whether you access the Find object from the Selection object or the Range object. The Find object is available from the Selection object and the Range object. Finding and replacing is exposed by the Find and Replacement objects.
0 Comments
Leave a Reply. |