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