PDA

View Full Version : Opening a Word file at the page which was last visited.



volabos
12-11-2007, 07:29 PM
Hi all, I would like to find some mechanism or possibly Macro, which will enable me to open a Word file at the same page or paragraph, which was last visited. Means, when I open a eord file, it generally opens at the 1st page, but I dont need that. i want that, at time of opening, it will carry me directly to that page or paragraph, which was visited at the time of previous closing of that word file. Adobe acrobat 07 has this type of feature. Can anyone tell me how to do this in Word? Your help will be highly appreciated.

Thanks and regards,
:dunno

TonyJollans
12-12-2007, 05:31 AM
You need an AutoOpen macro. Simplest one would be:

Sub autoopen
Wordbasic.goback
End sub

but see http://word.mvps.org/FAQs/AppErrors/GoBackFix.htm
But see

fumei
12-12-2007, 10:51 AM
When working on big documents I definitely like to have this feature. Tony's GoBack is indeed the simplest.

Or you can explicitly set a bookmark with Document_Close, and go to it on Document_Open. Like this:Sub Document_Close()
ActiveDocument.Bookmarks.Add _
Name:="StoppedHere", Range:=Selection.Range
End Sub


Sub Document_Open()
If ActiveDocument.Bookmarks.Exists("StoppedHere") = True Then
Selection.GoTo what:=wdGoToBookmark, Name:="StoppedHere"
ActiveDocument.Bookmarks("StoppedHere").Delete
End If
End SubWhen the document is closed it sets a bookmark at the current Selection.

When the document is opened it goes to that bookmark, and then deletes it. It deletes it so that when it is closed a new bookmark is set every time.

volabos
12-13-2007, 05:13 AM
Thanks Fumei for ur suggestion. This is that help, I was looking for. Also thanks to everyone who looked at my problem.

Have a nice day :)

djl0525
12-13-2007, 09:13 PM
Here is a non-VB way. You know how F5 is the go to key? And the Shift key is like a reverse button? Well, Shift + F5 is the reverse go to. Pressing Shift + F5 will take you cursor back to the last 3 edit locations. Just an FYI.

DJ

fumei
12-14-2007, 01:52 PM
Quite true and is the most straightforward way to return to the last location, except I believe the OP asked for an automatic movement, with no user action.

"i want that, at time of opening, it will carry me directly to that page or paragraph, which was visited at the time of previous closing of that word file."

djl0525
12-14-2007, 01:56 PM
Thank you -- DJ