Post date: Feb 10, 2014 11:8:28 PM
If Application.GoBack does not work in your version of Word, you can still return to the last location you edited when you reopen the document by using a bookmark. The AutoClose macro saves the current location as a bookmark when you close a document. The AutoOpen macro then jumps to that bookmark on open. The code was developed by Edward Mendelson and published in PC Magazine at
http://www.pcmag.com/article2/0,2817,2329214,00.asp
Sub AutoClose()
On Error Resume Next
If ActiveDocument.Words.Count > 1 Then
With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:="LastEditPosition"
End With
End If
End Sub
Sub AutoOpen()
On Error Resume Next
If ActiveDocument.Bookmarks.Exists("LastEditPosition") = True Then
Selection.GoTo What:=wdGoToBookmark, Name:="LastEditPosition"
End If
End Sub
If you do not like the prompting to save the file on close, you can follow the practice of Graham Mayor and save the bookmark whenever the document is saved, as done in the following code. See the post in the Office Community at
Sub FileSave()
On Error Resume Next
ActiveDocument.Bookmarks.Add Range:=Selection.Range, Name:="LastEditPosition"
ActiveDocument.Save
End Sub
Sub FileSaveAs()
On Error Resume Next
ActiveDocument.Bookmarks.Add Range:=Selection.Range, Name:="LastEditPosition"
Dialogs(wdDialogFileSaveAs).Show
End Sub