Wrap Property

Microsoft Word Visual Basic

WdFindWrap can be one of these WdFindWrap constants.
wdFindAsk After searching the selection or range, Word displays a message asking whether to search the remainder of the document.
wdFindContinue The find operation continues when the beginning or end of the search range is reached.
wdFindStop The find operation ends when the beginning or end of the search range is reached.

expression.Wrap

expression    Required. An expression that returns a Find object.

Example

The following example searches forward through the document for the word "aspirin." When the end of the document is reached, the search continues at the beginning of the document. If the word "aspirin" is found, it's selected.

Sub WordFind()
    With Selection.Find
        .Forward = True
        .ClearFormatting
        .MatchWholeWord = True
        .MatchCase = False
        .Wrap = wdFindContinue
        .Execute FindText:="aspirin"
    End With
End Sub