Mega Code Archive

 
Categories / VisualBasic Script / Word
 

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

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