Move Selection left : Document Selection « Word « VBA / Excel / Access / Word






Move Selection left

 
Sub select()
    Dim curSel
    With Documents("yourDocument.doc")
        If Selection.Information(wdAtEndOfRowMarker) = True Then
            Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdMove
        Else
            If curSel <> "" Then curSel.Select
            Set curSel = Nothing
        End If
    End With
End Sub

 








Related examples in the same category

1.Using a variable named curSel to restore the selection it collapses, unless collapsing the selection leaves the selection at an end-of-row marker
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.