Strange behavior on word form goto command buttons

I have a Word form (Link to Document) that contains a variety of FORMTEXT fields, and button to update all of the REF fields that are further down in the document. These fields pull selected data from the form fields to display it for different users. The first page of the document contains command buttons for "jumping" to different section of the document (using Selection.goto). This document was originally created in Word 2010, then converted to 2013.

In Word 2010, the document works just as expected, but after opening the document in 2013 and clicking on any one of these buttons, something seems to break. After clicking on one of the "jump" buttons, the cursor moves to the specified section of the document. If I scroll up to the top, all of the other buttons simply become selected when clicked. It is almost as if it is in design mode (although double-clicking does not go to the VBA code). After banging my head into the wall for hours, and doing an exhaustive internet search, I did discover that if I toggle Design Mode on, then off, at this point, any one of the other buttons becomes click-able and jumps the corresponding section as expected, but again, if I scroll up, the buttons are no longer working.

On the same page as the "jump" buttons (in fact, in adjacent cells in a table) are buttons to print the corresponding sections. These buttons work as they always did without needing to toggle design mode. However, if one of the jump buttons is clicked first, then the print buttons become dead.

It should be noted that the button to update the fields works just fine.

Private Sub gotoVicePresident_Click()
Selection.GoTo What:=wdGoToSection, Name:=Sections(3).Index
End Sub
Private Sub gotoAreaController_Click()
Selection.GoTo What:=wdGoToSection, Name:=Sections(4).Index
End Sub
Private Sub gotoProgramDirector_Click()
Selection.GoTo What:=wdGoToSection, Name:=Sections(5).Index
End Sub
Private Sub gotoHumanResources_Click()
Selection.GoTo What:=wdGoToSection, Name:=Sections(6).Index
End Sub
Private Sub gotoQIDA_Click()
Selection.GoTo What:=wdGoToSection, Name:=Sections(7).Index
End Sub
Private Sub gotoLAC_Click()
Selection.GoTo What:=wdGoToSection, Name:=Sections(8).Index
End Sub
Private Sub gotoFinance_Click()
Selection.GoTo What:=wdGoToSection, Name:=Sections(9).Index
End Sub
Private Sub gotoFacilities_Click()
Selection.GoTo What:=wdGoToSection, Name:=Sections(10).Index
End Sub
Private Sub gotoAdvocacy_Click()
Selection.GoTo What:=wdGoToSection, Name:=Sections(11).Index
End Sub
Private Sub gotoDirectorOfPrograms_Click()
Selection.GoTo What:=wdGoToSection, Name:=Sections(12).Index
End Sub
Private Sub gotoCommunications_Click()
Selection.GoTo What:=wdGoToSection, Name:=Sections(13).Index
End Sub
Private Sub gotoTechnology_Click()
Selection.GoTo What:=wdGoToSection, Name:=Sections(14).Index
End Sub
Private Sub printVicePresident_Click()
ActiveDocument.PrintOut Range:=wdPrintRangeOfPages, Copies:=1, Pages:="s3"
End Sub
Private Sub printAreaController_Click()
ActiveDocument.PrintOut Range:=wdPrintRangeOfPages, Copies:=1, Pages:="s4"
End Sub
Private Sub printProgramDirector_Click()
ActiveDocument.PrintOut Range:=wdPrintRangeOfPages, Copies:=1, Pages:="s5"
End Sub
Private Sub printHumanResources_Click()
ActiveDocument.PrintOut Range:=wdPrintRangeOfPages, Copies:=1, Pages:="s6"
End Sub
Private Sub printQIDA_Click()
ActiveDocument.PrintOut Range:=wdPrintRangeOfPages, Copies:=1, Pages:="s7"
End Sub
Private Sub printLAC_Click()
ActiveDocument.PrintOut Range:=wdPrintRangeOfPages, Copies:=1, Pages:="s8"
End Sub
Private Sub printFinance_Click()
ActiveDocument.PrintOut Range:=wdPrintRangeOfPages, Copies:=1, Pages:="s9"
End Sub
Private Sub printFacilities_Click()
ActiveDocument.PrintOut Range:=wdPrintRangeOfPages, Copies:=1, Pages:="s10"
End Sub
Private Sub printAdvocacy_Click()
ActiveDocument.PrintOut Range:=wdPrintRangeOfPages, Copies:=1, Pages:="s11"
End Sub
Private Sub printDirectorOfPrograms_Click()
ActiveDocument.PrintOut Range:=wdPrintRangeOfPages, Copies:=1, Pages:="s12"
End Sub
Private Sub printCommunications_Click()
ActiveDocument.PrintOut Range:=wdPrintRangeOfPages, Copies:=1, Pages:="s13"
End Sub
Private Sub printTechnology_Click()
ActiveDocument.PrintOut Range:=wdPrintRangeOfPages, Copies:=1, Pages:="s14"
End Sub
Private Sub updateFields_Click()
Dim oStory As Range
For Each oStory In ActiveDocument.StoryRanges
oStory.Fields.Update
If oStory.StoryType <> wdMainTextStory Then
While Not (oStory.NextStoryRange Is Nothing)
Set oStory = oStory.NextStoryRange
oStory.Fields.Update
Wend
End If
Next oStory
Set oStory = Nothing
End Sub

If anyone can figure this out, I will be very appreciative.

Thank You,

Matthew Weber

I had a colleague download the document to make sure the link worked, and the buttons seemed to work fine on their machine. I have repaired Office 2013 and reset all settings to default, but the problem persists on my machine.

Hopefully, one of you will be able to recreate the error. If not, I must be cursed.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

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

How satisfied are you with this reply?

Thanks for your feedback.

I was hoping someone would have replied to say they could reproduce the error. It doesn't occur for me.

The only troubleshooting tip I can suggest is to put a breakpoint in the code of each of the jump buttons. Then at least you can tell whether the code is executing at all when a button is clicked. If not, though -- if clicking the button doesn't make the macro editor pop up with a yellow arrow in the left margin pointing to the  appropriate line -- I don't know of anything you can do about it.


_____________________________
https://jay-freedman.info

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

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

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated October 5, 2021 Views 154 Applies to: