Find Object
Word Developer Reference |
Represents the criteria for a find operation.
Remarks
The properties and methods of the Find object correspond to the options in the Find and Replace dialog box.
Use the Find property to return a Find object. The following example finds and selects the next occurrence of the word "hi."
Visual Basic for Applications |
---|
|
The following example finds all occurrences of the word "hi" in the active document and replaces the word with "hello."
Visual Basic for Applications |
---|
|
Remarks
If you've gotten to the Find object from the Selection object, the selection is changed when text matching the find criteria is found. The following example selects the next occurrence of the word "blue."
Visual Basic for Applications |
---|
|
If you've gotten to the Find object from the Range object, the selection isn't changed when text matching the find criteria is found, but the Range object is redefined. The following example locates the first occurrence of the word "blue" in the active document. If "blue" is found in the document, myRange is redefined and bold formatting is applied to "blue."
Visual Basic for Applications |
---|
|
See Also