Selection.EndOf Method

Moves or extends the ending character position of a selection to the end of the nearest specified text unit.

Namespace:  Microsoft.Office.Interop.Word
Assembly:  Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)

Syntax

'Declaration
Function EndOf ( _
    ByRef Unit As Object, _
    ByRef Extend As Object _
) As Integer
'Usage
Dim instance As Selection
Dim Unit As Object
Dim Extend As Object
Dim returnValue As Integer

returnValue = instance.EndOf(Unit, Extend)
int EndOf(
    ref Object Unit,
    ref Object Extend
)

Parameters

  • Unit
    Type: System.Object%
    Optional Object. The unit by which to move the ending character position. WdUnits.

Return Value

Type: System.Int32

Remarks

This method returns a value that indicates the number of character positions the selection was moved or extended (movement is forward in the document).

If the both the starting and ending positions for the selection are already at the end of the specified unit, this method doesn't move or extend the selection.

See Also

Reference

Selection Interface

Selection Members

Microsoft.Office.Interop.Word Namespace