CTextRange2.EndOfmethod
Moves this range's ends to the end of the last overlapping *Unit* in the range.
Syntax
FUNCTION EndOf (BYVAL Unit AS LONG, BYVAL Extend AS LONG = 0) AS LONG
Parameters
| Name | Description | |
|---|---|---|
Unit | Unit to use. efault value: tomWord. For a list of Unit values, see the table below. | |
Extend | Indicator of how the shifting of the range ends is to proceed. It can be one of the following. |
Return value
The number of characters the insertion point or End is moved plus 1 if a collapse occurs to the entry End. If the range includes the final CR (carriage return) (at the end of the story) and Extend = tomMove, then the method returns –1 to indicate that the collapse occurred before the end of the range (because an insertion point cannot exist beyond the final CR).
Description
Moves this range's ends to the end of the last overlapping Unit in the range.
Table of Unit values:
Remarks
For comparison, the StartOf method moves the range ends to the beginning of the first overlapping Unit in the range. Note, 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 Start and EndOf extends from End. If the range is an insertion point on a boundary between Units, EndOf does not change End. In particular, calling EndOf (tomCharacter, 0) does not change End except for an insertion point at the beginning of a story.
Reference
- Defined in AfxNova/CTextRange2.inc:475
- Documented in Windows/WIndows Controls/RichEdit/CTextRange2 Class.md
- Topic: CTextRange2 Class