ITextRange::StartOf method (tom.h)
Moves the range ends to the start of the first overlapping Unit in the range.
HRESULT StartOf( long Unit, long Extend, long *pDelta );
Unit to use in the move operation. For a list of Unit values, see the discussion under ITextRange.
How to move the ends of the range. It can be one of the following values.
|0 (or tomMove)||Collapses a nondegenerate range to the start position by moving the insertion point. This is the default.|
|1 (or tomExtend)||Moves the start position to the beginning of the overlapping Unit. Does not move the end position.|
Pointer to a variable that receives the number of characters that the start position is moved. It can be null. On return, pDelta is the signed number of characters that the insertion point or start position is moved. This value is always less than or equal to zero, because the motion is always toward the beginning of the story.
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 range is an insertion point on a boundary between Units, ITextRange::StartOf does not change the start position.
The ITextRange::StartOf and ITextRange::EndOf methods differ from the HomeKey and EndKey methods in that the latter extend from the active end, whereas ITextRange::StartOf extends from the start position and ITextRange::EndOf extends from the end position.
|Minimum supported client||Windows Vista [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|