Shift + F5 not working in Word 2016

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

Re: Shift + F5 not working in Word 2016

Post by DaveA »

See post 7 above this one
I am so far behind, I think I am First :evilgrin:
Genealogy....confusing the dead and annoying the living

User avatar
Charles Kenyon
3StarLounger
Posts: 290
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: Shift + F5 not working in Word 2016

Post by Charles Kenyon »

hlewton wrote:
30 Apr 2020, 14:41
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
See your later post at http://www.eileenslounge.com/viewtopic.php?f=26&t=34883 for an error handler for the AutoOpen.
Attorney Charles Kenyon

Templates in Microsoft Word http://www.addbalance.com/usersguide/templates.htm
Modifying the QAT http://addbalance.com/word/QATmodification.htm

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

Re: Shift + F5 not working in Word 2016

Post by hlewton »

Charles Kenyon wrote:
30 Jun 2020, 02:41
hlewton wrote:
30 Apr 2020, 14:41
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
See your later post at http://www.eileenslounge.com/viewtopic.php?f=26&t=34883 for an error handler for the AutoOpen.
Are you suggestion that the last part of this visual basic be replaced with the one from my other post? I ask because this one seems to be working perfect for me the way it is and I have never had that error pop up that caused me to start that other post? Sorry I just don't understand visual basic well enough to know if this last part would change the way word opens the document to the place it was last saved or not.
Regards,
hlewton

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

Re: Shift + F5 not working in Word 2016

Post by HansV »

The last macro (Sub AutoOpen) is the one that you reported to have caused a problem in the other thread...
Regards,
Hans

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

Re: Shift + F5 not working in Word 2016

Post by Jay Freedman »

You can make the replacement. If no error occurs, the old and new versions of the macro behave exactly the same. However, if the error does occur, the macro from the other thread will prevent the message box from appearing. That's enough of a benefit to justify making the replacement.

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

Re: Shift + F5 not working in Word 2016

Post by hlewton »

HansV wrote:
30 Jun 2020, 13:51
The last macro (Sub AutoOpen) is the one that you reported to have caused a problem in the other thread...
Yes and that has been corrected but the suggestion in the post above my last post here is what I was wondering about. I think the (Sub AutoOpen) is the same in both posts. So I'm not sure what was mentioned. I guess I was confused when I saw this
See your later post at http://www.eileenslounge.com/viewtopic.php?f=26&t=34883 for an error handler for the AutoOpen.
But I think everything is working fine.
Regards,
hlewton

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

Re: Shift + F5 not working in Word 2016

Post by hlewton »

Jay Freedman wrote:
30 Jun 2020, 14:39
You can make the replacement. If no error occurs, the old and new versions of the macro behave exactly the same. However, if the error does occur, the macro from the other thread will prevent the message box from appearing. That's enough of a benefit to justify making the replacement.
Thank you. I think the macros are the same right now as far as I can tell.
These are from both threads and I believe they are the same. One is from that Ice Word document and the other just in Word itself.
Sub AutoOpen()
On Error GoTo ExitHere
If ActiveDocument.Bookmarks.Exists("OpenAt") Then
ActiveDocument.Bookmarks("OpenAt").Select
End If
ExitHere:
End Sub

And this if from this thread

Sub AutoOpen()
On Error GoTo ExitHere
If ActiveDocument.Bookmarks.Exists("OpenAt") Then
ActiveDocument.Bookmarks("OpenAt").Select
End If
ExitHere:
End Sub
Regards,
hlewton