CTextRange2.StartOfmethod
Moves the range ends to the start of the first overlapping *Unit* in the range.
Syntax
FUNCTION StartOf (BYVAL Unit AS LONG, BYVAL Extend AS LONG = 0) AS LONG
Parameters
| Name | Description | |
|---|---|---|
Unit | Unit to use in the move operation. For a list of Unit values, see the table below. | |
Extend | How to move the ends of the range. It can be one of the following values. |
Return value
The signed number of characters that the start position is moved. It can be null. 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.
Description
Moves the range ends to the start of the first overlapping Unit in the range.
Table of Unit values:
Remarks
If the range is an insertion point on a boundary between Units, StartOf does not change the start position.
The StartOf and EndOf methods differ from the HomeKey and EndKey methods in that the latter extend from the active end, whereas StartOf extends from the start position and EndOf extends from the end position.
Reference
- Defined in AfxNova/CTextRange2.inc:465
- Documented in Windows/WIndows Controls/RichEdit/CTextRange2 Class.md
- Topic: CTextRange2 Class