ITextRange::MoveStartUntil method

Moves the start position of the range the position of the first character found that is in the set of characters specified by Cset, provided that the character is found within Count characters of the start position.

Syntax


HRESULT MoveStartUntil(
  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 is forward—toward the end of the story—and if Count is less than zero, search is backward—toward the beginning. If Count is zero, the start position is unchanged.

pDelta

Type: long*

The actual number of characters the start of the range is moved, plus 1 for a match if Count is greater than zero, and –1 for a match if Count is less than zero. 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 codeDescription
E_INVALIDARG

Cset is not valid.

S_FALSE

Failure for some other reason.

 

Remarks

If no character from Cset is found within Count positions of the start position, the range is left unchanged.

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

The motion described by ITextRange::MoveStartUntil 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

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
Move
MoveUntil
Conceptual
Text Object Model

 

 

Community Additions

ADD
Show:
© 2014 Microsoft