Microsoft Word Suite
252
[match forward Boolean] Optional. True to search forward (toward the end of the document).
[wrap find enumeration] Optional. Controls what happens if the search begins at a point other
than the beginning of the document and the end of the document is reached (or vice versa if
match forward is set to false). This argument also controls what happens if theres a selection
or text range and the search text isnt found in the selection or range. Can be one of the
following:
Constant
Description
find ask
After searching the selection or range, Word displays a message asking
whether to search the remainder of the document.
find
continue
The find operation continues if the beginning or end of the search range is
reached.
find stop
The find operation ends if the beginning or end of the search range is
reached.
[find format Boolean] Optional. True to have the find operation locate formatting in addition to
or instead of the find text.
[replace with Unicode text] Optional. The replacement text. To delete the text specified by the
find text argument, use an empty string (). You specify special characters and advanced
search criteria just as you do for the find text argument. To specify a graphic object or other
nontext item as the replacement, put the item on the Clipboard and specify ^c for replace
with.
[replace enumeration] Optional. Specifies how many replacements are to be made: one, all, or
none. Can be one of the following: replace all, replace none, or replace one.
Example
This example finds and selects the next occurrence of the word "library."
set myFind to find object of selection
clear formatting myFind
set match whole word of myFind to true
set match case of myFind to false
execute find myFind find text "library"
This example finds all occurrences of the word "hi" in the active document and replaces each
occurrence with "hello."
set myRange to text object of active document
execute find find object of myRange find text "hi" replace with "Hello" ¬
replace replace all