ITextRange::FindTextStart method

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. If the string is found, the Start cp is changed to the matched string, and pLength is set equal to the length of the string. If the string is not found, the range is unchanged, and pLength is set equal to zero.

Syntax


HRESULT FindTextStart(
  BSTR bstr,
  long Count,
  long Flags,
  long *pLength
);

Parameters

bstr

Type: BSTR

The string to search for.

Count

Type: long

Maximum number of characters to search. It can be one of the following.

tomForwardSearch to the end of the story. This is the default value.
n (greater than 0)Search forward for n chars, starting from cpLim.
n (less than 0)Search backward for n chars, starting from cpLim.

 

Flags

Type: long

Flags governing the comparisons. It can be zero (the default) or any combination of the following values.

tomMatchWord2Matches whole words.
tomMatchCase4Matches case.
tomMatchPattern8Matches regular expressions.

 

pLength

Type: long*

The length of the matched string.

Return value

Type: HRESULT

The method returns an HRESULT value. If the method succeeds, it returns S_OK. If the method fails, it returns S_FALSE.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Tom.h

DLL

Msftedit.dll

See also

Reference
ITextRange
FindText
FindTextEnd
Conceptual
Text Object Model

 

 

Community Additions

ADD
Show:
© 2014 Microsoft