I am using MS Word 2003.....I have created a number of command buttons in a document that provide tidbits of information when clicked. The code I am using to create these buttons is as follows:
Private Sub CommandButtonNameofButton_Click()
intMessage = MsgBox("This is my text.", vbInformation, "This is my title.")
End Sub
This works great when I add the button to a new document. I can create a button, save my changes, and continue on to a new button, and all of the buttons work fine. However, once I close the document, when I re-open it, the buttons no longer function. I have tried locking the document (didn't work). I have tried going to Tools, Options, Security, Macro Security, Trusted Sources, and checking the box for "Trust Access to Visual Basic Project" (didn't work). I asked someone else to try the buttons on the document, and it didn't work either, so I don't believe it's just a setting on my PC.
I have tried to search this and other forums for a solution but haven't found one yet.
Any suggestions? I am new to using code in a Word document (or anywhere.....) so I really need help! Thanks!
Private Sub CommandButtonNameofButton_Click()
intMessage = MsgBox("This is my text.", vbInformation, "This is my title.")
End Sub
This works great when I add the button to a new document. I can create a button, save my changes, and continue on to a new button, and all of the buttons work fine. However, once I close the document, when I re-open it, the buttons no longer function. I have tried locking the document (didn't work). I have tried going to Tools, Options, Security, Macro Security, Trusted Sources, and checking the box for "Trust Access to Visual Basic Project" (didn't work). I asked someone else to try the buttons on the document, and it didn't work either, so I don't believe it's just a setting on my PC.
I have tried to search this and other forums for a solution but haven't found one yet.
Any suggestions? I am new to using code in a Word document (or anywhere.....) so I really need help! Thanks!