Selection.StartOf Method

Moves or extends the start position of the specified selection to the beginning 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 StartOf ( _
    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.StartOf(Unit, Extend)
int StartOf(
    ref Object Unit,
    ref Object Extend
)

Parameters

  • Unit
    Type: System.Object%
    Optional WdUnits. The unit by which the start position of the specified range or selection is to be moved.

Return Value

Type: System.Int32

Remarks

This method returns an Integer that indicates the number of characters by which the selection was moved or extended. The method returns a negative number if the movement is backward through the document.

If the beginning of the specified selection is already at the beginning 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