Find Method

See Also         Example         Applies To

Finds the specified text in a text range, and returns a TextRange object that represents the first text range where the text is found. Returns Nothing if no match is found.

Syntax

expression.Find(FindWhat, After, MatchCase, WholeWords)

expression   Required. An expression that returns a TextRange object.

FindWhat   Required String. The text to search for.

After   Optional Long. The position of the character (in the specified text range) after which you want to search for the next occurrence of FindWhat. For example, if you want to search from the fifth character of the text range, specify 4 for After. If this argument is omitted, the first character of the text range is used as the starting point for the search.

MatchCase   Optional Long. True to have the search distinguish between uppercase and lowercase characters. The default value is False.

WholeWords   Optional Long. True to have the search find only whole words, and not parts of larger words as well. The default value is False.