ITextRange::MoveEnd method (tom.h)
Moves the end position of the range.
HRESULT MoveEnd( long Unit, long Count, long *pDelta );
The units by which to move the end of the range. The default value is tomCharacter. For a list of the other unit values, see ITextRange.
The number of units to move past. The default value is 1. If Count is greater than zero, motion is forward—toward the end of the story—and if Count is less than zero, motion is backward—toward the beginning. If Count is zero, the end position is unchanged.
The actual number of units that the end position of the range is moved past. The value can be null.
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.
||Unit is not supported.|
||Failure for some other reason.|
If the new end position precedes the old start position, the new start position is set equal to the new end position; that is, it becomes a degenerate range or an insertion point.
The motion described by ITextRange::MoveEnd 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.
|Minimum supported client||Windows Vista [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|