EditFindFound()

Syntax

EditFindFound()

Remarks

Returns a value indicating whether the most recent EditFind operation was successful.

Value

Explanation

–1

The find operation was successful.

0 (zero)

The find operation was not successful.


Example

This macro counts the number of times "pillbox" occurs in a document and then displays the result in a message box. EditFindFound() is often used with a While¼Wend loop to repeat a series of instructions each time the specified text or formatting is found.


Sub MAIN
count = 0
StartOfDocument
EditFind .Find = "pillbox", .WholeWord = 1, .Format = 0, .Wrap = 0
While EditFindFound()
    count = count + 1
    EditFind
Wend
MsgBox "The word " + Chr$(34) + "pillbox" + Chr$(34) + \
    " was found" + Str$(count) + " times."
End Sub

See Also

EditFind, EditReplace, While¼Wend