Selection.EndKey (Word)

Moves or extends the selection to the end of the specified unit.

This method returns an integer that indicates the number of characters the selection or active end was actually moved, or it returns 0 (zero) if the move was unsuccessful. This method corresponds to functionality of the END key.

EndKey (Unit, Extend)


pos = Selection.EndKey(Unit:=wdLine, Extend:=wdMove)

Arguments

Optional arguments

The following arguments are optional

Unit (WdUnits) - The unit by which the selection is to be moved or extended. Can be a WdUnits constant. The default value is wdLine.

Here you can find possible values for WdUnits

Extend (WdMovementType) - Specifies the way the selection is moved. Can be any WdMovementType constant. If the value of this argument is wdMove, the selection is collapsed to an insertion point and moved to the end of the specified unit. If it is wdExtend, the end of the selection is extended to the end of the specified unit. The default value is wdMove.

Possible return values are wdExtend - The end of the selection is extended to the end of the specified unit, wdMove - The selection is collapsed to an insertion point and moved to the end of the specified unit. Default.