Shift + F5 not working in Word 2016

User avatar
hlewton
GoldLounger
Posts: 2570
Joined: 24 Oct 2010, 23:39
Location: Canton, Ohio USA

Shift + F5 not working in Word 2016

Post by hlewton »

When trying to go to where I last edited in a very lengthy Word document I have always used "Shift + F5" since learning about it here. Shift + F5 has stopped working. How can this be fixed? Thanks
Regards,
hlewton

User avatar
HansV
Administrator
Posts: 69052
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Shift + F5 not working in Word 2016

Post by HansV »

In my experience, this feature has been wonky in all recent versions of Word...
Regards,
Hans

User avatar
hlewton
GoldLounger
Posts: 2570
Joined: 24 Oct 2010, 23:39
Location: Canton, Ohio USA

Re: Shift + F5 not working in Word 2016

Post by hlewton »

HansV wrote:In my experience, this feature has been wonky in all recent versions of Word...
Yeah wish they would fix it.
Regards,
hlewton

User avatar
hlewton
GoldLounger
Posts: 2570
Joined: 24 Oct 2010, 23:39
Location: Canton, Ohio USA

Re: Shift + F5 not working in Word 2016

Post by hlewton »

Hans I found this on the net. It was talking about Word 2013. Will it work for me and if so how do I insert it into the Normal.dotm? I believe Word uses the extention of ".dotm" Also how would I use it to get me to where I want to be? Not sure how to activate the macro if I can use it at all.

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
Regards,
hlewton

User avatar
HansV
Administrator
Posts: 69052
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Shift + F5 not working in Word 2016

Post by HansV »

Press Alt+F11 to activate the Visual Basic Editor.
Click on Normal in the project explorer pane on the left hand side:
S3279.png
Select Insert > Module.
Copy the code into this module.
Press Alt+F4 to close the Visual Basic Editor and to return to Word.
Quit Word. If it asks you whether to save changes to the default template, click Yes.
Start Word again.
Open a document, make some changes, then close and save it.
When you reopen the document, you should return to the location where you were when you closed it.
You do not have the required permissions to view the files attached to this post.
Regards,
Hans

User avatar
DaveA
SilverLounger
Posts: 2479
Joined: 24 Jan 2010, 15:26
Location: Olympia, WA

Re: Shift + F5 not working in Word 2016

Post by DaveA »

hlewton,
You are not alone it has not worked for several weeks
I am using Office 365 on a Windows 10 machine
I am so far behind, I think I am First :evilgrin:
Genealogy....confusing the dead and annoying the living

User avatar
hlewton
GoldLounger
Posts: 2570
Joined: 24 Oct 2010, 23:39
Location: Canton, Ohio USA

Re: Shift + F5 not working in Word 2016

Post by hlewton »

HansV wrote:Press Alt+F11 to activate the Visual Basic Editor.
Click on Normal in the project explorer pane on the left hand side:
S3279.png
Select Insert > Module.
Copy the code into this module.
Press Alt+F4 to close the Visual Basic Editor and to return to Word.
Quit Word. If it asks you whether to save changes to the default template, click Yes.
Start Word again.
Open a document, make some changes, then close and save it.
When you reopen the document, you should return to the location where you were when you closed it.
Once I open the module do I have to name this macro or does this macro just automatically take me to where I want to be without a name?
Last edited by hlewton on 30 Apr 2020, 15:03, edited 2 times in total.
Regards,
hlewton

User avatar
hlewton
GoldLounger
Posts: 2570
Joined: 24 Oct 2010, 23:39
Location: Canton, Ohio USA

Re: Shift + F5 not working in Word 2016

Post by hlewton »

DaveA wrote:hlewton,
You are not alone it has not worked for several weeks
I am using Office 365 on a Windows 10 machine
Yep the problem is MS doesn't seem to care.
Regards,
hlewton

User avatar
hlewton
GoldLounger
Posts: 2570
Joined: 24 Oct 2010, 23:39
Location: Canton, Ohio USA

Re: Shift + F5 not working in Word 2016

Post by hlewton »

I tried it without any name. It seems to work but when I closed Word it didn't ask me anything but it still is working. As I was practicing what Hans told me it created 2 blnnk modules. Should I be concerned about that and if so how do I delete them because they don't seem to appear when I click in the drop down beside "Modules?"
Regards,
hlewton

User avatar
hlewton
GoldLounger
Posts: 2570
Joined: 24 Oct 2010, 23:39
Location: Canton, Ohio USA

Re: Shift + F5 not working in Word 2016

Post by hlewton »

OK Let me ask this. I found the following article with yet another code which I believe makes the "Shift + F5" work again. If that is the way you see it can I insert this code as a module? If that is possible, how do I delete the previous module? If I can use this module do I use the first 2 lines - "Option Explicit and Dim DocWasClosed As Boolean" also? Thanks.

GoBack (Shift+F5) doesn't work in some newly-opened documents
Article contributed by Andria Pinson and Dave Rado
Background

One of the most useful Word shortcuts is Shift+F5, which invokes the GoBack command and returns the selection to the previous editing point. It's useful both while editing (for instance, having copied something, to return to where you were typing previously in order to paste); and when you open a document, in order to return to where you edited it last.
When editing, Shift+F5 goes back to up to three editing points, and when you press it a fourth time, it returns to where you started. When you open a document, it only “remembers” the last editing point.

Either way, it works by storing a built-in bookmark called \PrevSel1 in the document, which it can then return to; and in fact, instead of using the Shift+F5 shortcut, you can select Edit + Go To (or press F5), select “Bookmark” in the left pane, type \PrevSel1 on the right, and click the “Go to” button. (Here's a challenge for you – try to find the list of built-in bookmarks in Word's Help! Given up? Fortunately, they are all listed in Microsoft Knowledge Base article Q212555.)

Some people like to take advantage of this by having Word automatically open their most recent file when they open Word, and retuning the selection automatically to the last editing point, so they can carry on typing where they left off. For details of how to do this, see: How to get the most recently used document to be opened automatically when you open Word.

The bug
If using Word 2000 or higher, you will notice that some files you open won't “go back” when you press Shift+F5.
This is because in Word 2000 and above, the \PrevSel1 bookmark isn't set in the last document that's closed when you exit Word, if you select “Yes” to save the changes to the document.
In fact, in this scenario, even if the \PrevSel1 bookmark exists prior to closing the document, it's actually destroyed when the document is saved!
This bug, which doesn't apply in Word 97, is a little reminiscent of the bug described in the first paragraph of the article: A Pseudo DocumentBeforeClose Event).



The fix

Put the following code into Normal.dot:

Option Explicit

Dim DocWasClosed As Boolean

Sub DocClose()
'Set a variable so that the AutoClose macro knows not to quit Word
On Error Resume Next
DocWasClosed = True
WordBasic.DocClose
If Err Then DocWasClosed = False
End Sub
________________________________________
Sub FileClose()
'Set a variable so that the AutoClose macro knows not to quit Word
On Error Resume Next
DocWasClosed = True
WordBasic.DocClose
If Err Then DocWasClosed = False
End Sub
________________________________________
Public Sub AutoClose()
On Error Resume Next
If Documents.Count = 1 Then
'make sure the doc is not in another application such as IE, Outlook, etc
If Not ActiveWindow.Caption = "" Then
'make sure it's "dirty"
If Not ActiveDocument.Saved Then
'Make sure it was not closed by invoking DocClose or FileClose commands
If Not DocWasClosed Then
'Create an extra "dummy" document, _
to prevent the "last doc" bug from manifesting
Documents.Add Visible:=False
'Can't quit Word yet or you get an error, so use OnTime
Application.OnTime When:=Now, Name:="FinishOffAutoClose"
End If
End If
End If
End If
'Reset the variable
DocWasClosed = False
End Sub
________________________________________
Sub FinishOffAutoClose()
Application.Quit
End Sub
________________________________________
Sub FileExit()
Application.Quit
End Sub
________________________________________
Notes: You have to use AutoClose rather than AutoExit or DocumentBeforeClose, because the latter both fire after the “Do you want to save changes” messages. Unfortunately, this means the code must be stored in Normal.dot (or in all your templates, but it can't be stored in an Add-in).
The FileExit macro is required because without it, invoking File + Exit won't allow you to cancel out of the "do you want to save changes" dialog, for some weird reason!
Regards,
hlewton

User avatar
HansV
Administrator
Posts: 69052
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Shift + F5 not working in Word 2016

Post by HansV »

hlewton wrote:when I closed Word it didn't ask me anything but it still is working.
By default, Word doesn't ask you, but there is a setting in File > Options that makes Word ask you to save changes to the default template. So my remark was for if you had turned on that setting.
Regards,
Hans

User avatar
HansV
Administrator
Posts: 69052
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Shift + F5 not working in Word 2016

Post by HansV »

hlewton wrote:As I was practicing what Hans told me it created 2 blnnk modules. Should I be concerned about that and if so how do I delete them because they don't seem to appear when I click in the drop down beside "Modules?"
Blank modules don't do anything, so no need to worry about them.
Regards,
Hans

User avatar
HansV
Administrator
Posts: 69052
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Shift + F5 not working in Word 2016

Post by HansV »

If you want to try the new code, activate the Visual Basic Editor again.
If necessary, expand Normal by clicking on the + to the left of it. (If it is already expanded, there will be a - instead of a +. You don't need to click on the -).
Then, if necessary, expand Modules under Normal by clicking on the + to the left of it. If there is a -, no need to expand.
Double-click the module under Modules.
Delete the code that you previously copied into it, then copy/paste the new code, from Option Explicit to the last End Sub.
Regards,
Hans

User avatar
Jay Freedman
Microsoft MVP
Posts: 1099
Joined: 24 May 2013, 15:33
Location: Willow Grove, PA

Re: Shift + F5 not working in Word 2016

Post by Jay Freedman »

This "GoBack Fix" article (https://wordmvp.com/FAQs/AppErrors/GoBackFix.htm) is too old to be useful. The code in it fixes a problem that no longer exists, and it doesn't fix the current problem.

I investigated this for a post on the Microsoft Answers forum, https://answers.microsoft.com/en-us/mso ... 2a0213e006. The problem this time is that Word doesn't even try to save the \PrevSel1 bookmark, regardless of whether the document being closed is the last/only open document. I tried coding a macro to save that bookmark, but it didn't work. This bug will have to be fixed by Microsoft.

User avatar
hlewton
GoldLounger
Posts: 2570
Joined: 24 Oct 2010, 23:39
Location: Canton, Ohio USA

Re: Shift + F5 not working in Word 2016

Post by hlewton »

OK thank you both. I will leave it as it is with the first macro because it at least takes me back to the last page I was on. That will work until Microsoft Soft, hopefully, fixes this problem.

Thanks again.
Regards,
hlewton

User avatar
DaveA
SilverLounger
Posts: 2479
Joined: 24 Jan 2010, 15:26
Location: Olympia, WA

Re: Shift + F5 not working in Word 2016

Post by DaveA »

Just up dated Office 365 to current updates and Shift f5 is working now!
I am so far behind, I think I am First :evilgrin:
Genealogy....confusing the dead and annoying the living

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 11305
Joined: 24 Jan 2010, 23:23
Location: paused.undefined.exposed

Re: Shift + F5 not working in Word 2016

Post by ChrisGreaves »

hlewton wrote:
30 Apr 2020, 15:40
Article contributed by Andria Pinson and Dave Rado ... When editing, Shift+F5 goes back to up to three editing points, ...
Hello hllewton.
Thanks for this thread; most illuminating!

I recognise that the quote above is not yours, but is attributed to Pinson and Rado.

I am using Word2003 and Shift-F5 has fallen down occasionally.
I have a vague (at my age) memory of learning somewhere that there was a buffer-size involved; that the limit to which one could go back was based on memory rather than ordinal numbers.
I have trouble justifying that, since in theory all MSWord needs is a set of memory locations, but perhaps MSWord stores other data for each location, maybe piggy-backs on the Bookmarking code.

I post this here in the hopes that at least one of my superiors (this board is full of them) will correct or refine my observations.

Cheers
Chris
People who live in glass houses shouldn’t grow zucchinis

User avatar
hlewton
GoldLounger
Posts: 2570
Joined: 24 Oct 2010, 23:39
Location: Canton, Ohio USA

Re: Shift + F5 not working in Word 2016

Post by hlewton »

ChrisGreaves wrote:
04 Jun 2020, 09:59


I post this here in the hopes that at least one of my superiors (this board is full of them) will correct or refine my observations.

Cheers
Chris
LOL that sure can't be me who could correct anything you said.
Regards,
hlewton

User avatar
DaveA
SilverLounger
Posts: 2479
Joined: 24 Jan 2010, 15:26
Location: Olympia, WA

Re: Shift + F5 not working in Word 2016

Post by DaveA »

Well, this morning the Shift F5 is NOT working again!
I am so far behind, I think I am First :evilgrin:
Genealogy....confusing the dead and annoying the living

User avatar
hlewton
GoldLounger
Posts: 2570
Joined: 24 Oct 2010, 23:39
Location: Canton, Ohio USA

Re: Shift + F5 not working in Word 2016

Post by hlewton »

DaveA wrote:
04 Jun 2020, 14:38
Well, this morning the Shift F5 is NOT working again!
By this post I am assuming you mean it had been working. Mine hasn't been for a long time.
Regards,
hlewton