How to get last session position in 2007 Word

S

Sevilho

Hi!

There was the simple and vary convenient AutoOpen macro in 2003 Word

Sub AutoOpen()
Application.GoBack
End Sub

that give last editing position when open document.

This macro does not work at all in 2007 Word. What can I do instead?
 
D

Doug Robbins - Word MVP

It does work the same in Word 2007 here.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
S

Suzanne S. Barnhill

Unfortunately, although the GoBack command (Shift+F5) works during an
editing session in Word 2007, the last edit point bookmark is not saved when
the document is closed. This is true only for .docx documents. If you save
the document in Word 97-2003 format, the bookmark is retained. I believe
this functionality has been restored in Word 2010.

See
http://www.microsoft.com/office/com...b998a5-7f13-4ede-887c-3d6f817a5a70&sloc=en-us

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
G

Graham Mayor

You can do it with three macros in the normal template

Sub FileSave()
On Error Resume Next
ActiveDocument.Bookmarks.Add Range:=Selection.Range, name:="OpenAt"
ActiveDocument.Save
End Sub

Sub FileSaveAs()
On Error Resume Next
ActiveDocument.Bookmarks.Add Range:=Selection.Range, name:="OpenAt"
Dialogs(wdDialogFileSaveAs).Show
End Sub

Sub AutoOpen()
If ActiveDocument.Bookmarks.Exists("OpenAt") = True Then
ActiveDocument.Bookmarks("OpenAt").Select
End If
End Sub

The documents will thus always open at the place the cursor was when the
document was saved.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Sevilho

Thank you vary much. It really works !!!

Graham Mayor said:
You can do it with three macros in the normal template

Sub FileSave()
On Error Resume Next
ActiveDocument.Bookmarks.Add Range:=Selection.Range, name:="OpenAt"
ActiveDocument.Save
End Sub

Sub FileSaveAs()
On Error Resume Next
ActiveDocument.Bookmarks.Add Range:=Selection.Range, name:="OpenAt"
Dialogs(wdDialogFileSaveAs).Show
End Sub

Sub AutoOpen()
If ActiveDocument.Bookmarks.Exists("OpenAt") = True Then
ActiveDocument.Bookmarks("OpenAt").Select
End If
End Sub

The documents will thus always open at the place the cursor was when the
document was saved.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>






.
 
S

Sevilho

Doug! You did not check what you write. I wrote it does not work, and you
wrote it work. Read all thread.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top