How to make word 2007 remember last position/page when re-opening a document?

HI]

How to make word 2007 remember last position/page when re-opening a document? To be more clear what I mean to say is this. Say you are writing a document and you end up somewhere between your 9th page. How does one make Word, upon opening that same document remeber it's last place--in this casethe 9th page?

 

thank you

 

Mich

Answer
Answer
You can record the position the cursor is in every time you save the document using a bookmark and then use an autoopen macro to select that bookmark. (The autoopen macro shown below has some extra commands that are optional). Save all the following (lifted from my own PC) in a module in the Normal Template - see http://www.gmayor.com/installing_macro.htm



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

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

Sub AutoOpen()
On Error Resume Next
    With ActiveWindow.View
        If Err.Number = 4248 Then Exit Sub
        .Type = wdPrintView
        .Zoom = 100
        .TableGridlines = True
    End With
    ActiveWindow.ActivePane.View.ShowAll = False
    ActiveWindow.ActivePane.View.ShowFieldCodes = False
    If ActiveDocument.Bookmarks.Exists("OpenAt") = True Then
        ActiveDocument.Bookmarks("OpenAt").Select
    End If
    InsertDocTitle
End Sub

Sub InsertDocTitle()
' Changes window title to include path with filename
    Dim NameArray As Variant
    Dim NameStringL As String
    Dim NameStringR As String
    Dim Count As Long
    Const maxLen = 120   ' set this value to fit your window width
    ' (avoid error if no active window)
    If Windows.Count > 0 Then
        NameStringL = ActiveDocument.FullName
        If Len(NameStringL) > maxLen Then
            ' separate the folder names
            NameArray = Split(NameStringL, "\")
            ' check the folder depth
            Count = UBound(NameArray)
            If Count > 3 Then
                NameStringL = NameArray(0) & "\...\"
                NameStringR = NameArray(Count)
                Count = Count - 1

                ' continue adding folders to the left of the string
                ' until you run out of folders or one won't fit
                Do While (Count > 0) And _
                   (Len(NameStringL) + Len(NameStringR) + _
                    Len(NameArray(Count)) < maxLen)
                    NameStringR = NameArray(Count) & "\" _
                                & NameStringR
                    Count = Count - 1
                Loop

                NameStringL = NameStringL & NameStringR
            End If
        End If

        ' Change the window's caption
        ActiveWindow.Caption = NameStringL
    End If
End Sub
Graham Mayor (Microsoft Word MVP 2002-2019)
For more Word tips and downloads visit my web site
https://www.gmayor.com/Word_pages.htm

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.

 
 

Question Info


Last updated June 8, 2020 Views 8,935 Applies to: