Help Center

CTextRange2.FindTextStartmethod

Searches up to *Count* characters for the string, *bstr*, starting at the range's Start *cp (cpFirst)*. The search is subject to the comparison parameter, *Flags*.

Windowsmethoddocumented

Syntax

FUNCTION FindTextStart (BYREF wszText AS WSTRING, BYVAL Count AS LONG = tomForward, BYVAL Flags AS LONG = 0) AS LONG

Parameters

NameDescription
wszTextThe string to search for.
CountMaximum number of characters to search. It can be one of the following.
- tomForward. Searches to the end of the story. This is the default value.
- n (greater than 0). Searches forward for n chars, starting from cpFirst. If the range itself matches cbs, another search is attempted from cpFirst + 1.
- n (less than 0). Searches backward for n chars, starting from cpLim.
FlagsFlags governing the comparisons. It can be zero (the default) or any combination of the following values.

Return value

The length of the matched string.

Description

Searches up to Count characters for the string, cbs, starting at the range's Start cp (cpFirst). The search is subject to the comparison parameter, Flags. If the string is found, the Start cp is changed to the matched string, and the method returns the length of the string. If the string is not found, the range is unchanged, and the method returns zero.

Reference

  • Defined in AfxNova/CTextRange2.inc:603
  • Documented in Windows/WIndows Controls/RichEdit/CTextRange2 Class.md
  • Topic: CTextRange2 Class