ITextRange::FindTextEnd method (tom.h)

Searches up to Count characters for the string, bstr, starting from the range's End cp. The search is subject to the comparison parameter, Flags. If the string is found, the End cp is changed to be the end of 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 FindTextEnd(
  BSTR bstr,
  long Count,
  long Flags,
  long *pLength
);

Parameters

bstr

Type: BSTR

String to search for.

Count

Type: long

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

tomForward Search 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 comparisons. It can be zero (the default) or any combination of the following values.

tomMatchWord 2 Matches whole words.
tomMatchCase 4 Matches case.
tomMatchPattern 8 Matches regular expressions.

pLength

Type: long*

The length of string matched.

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 Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header tom.h
DLL Msftedit.dll

See also

Conceptual

FindText

FindTextStart

ITextRange

Reference

Text Object Model