ITextRange::MoveEndWhile method (tom.h)

Moves the end of the range either Count characters or just past all contiguous characters that are found in the set of characters specified by Cset, whichever is less.

Syntax

HRESULT MoveEndWhile(
  VARIANT *Cset,
  long    Count,
  long    *pDelta
);

Parameters

Cset

Type: VARIANT*

The character set to use in the match. This could be an explicit string of characters or a character-set index. For more information, see Character Match Sets.

Count

Type: long

Maximum number of characters to move past. The default value is tomForward, which searches to the end of the story. If Count is greater than zero, the search moves forward (toward the end of the story). If Count is less than zero, the search moves backward (toward the beginning of the story). If Count is zero, the end position is unchanged.

pDelta

Type: long*

The actual number of characters that the end is moved. The value can be null.

Return value

Type: HRESULT

The method returns an HRESULT value. If the method succeeds, it returns S_OK. If the method fails, it returns one of the following error codes. For more information about COM error codes, see Error Handling in COM.

Return code Description
E_INVALIDARG
Cset is not valid.
S_FALSE
Failure for some other reason.

Remarks

If the new end precedes the old start, the new start is set equal to the new end.

The motion described by ITextRange::MoveEndWhile is logical rather than geometric. That is, motion is toward the end or toward the start of a story. Depending on the language, moving to the end of the story could be moving left or moving right.

For more information, see ITextRange and ITextRange::Move.

Requirements

Requirement Value
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

ITextRange

Move

MoveWhile

Reference

Text Object Model