Using a variable named curSel to restore the selection it collapses, unless collapsing the selection leaves the selection at an end-of-row marker : Document Selection « Word « VBA / Excel / Access / Word






Using a variable named curSel to restore the selection it collapses, unless collapsing the selection leaves the selection at an end-of-row marker

 
Sub select()
    Dim curSel
    With Documents("yourDocument.doc")
        If Selection.Type <> wdSelectionIP Then
            Set curSel = Selection.Range
            Selection.Collapse Direction:=wdCollapseStart
        End If
    End With
End Sub

 








Related examples in the same category

1.Move Selection left
2.wdStartOfRangeColumnNumber returns the number of the column in which the beginning of the selection or range falls.
3.checks the number of rows and columns in the selection.