Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Word-Command Buttons Don't Work After Closing Document

Status
Not open for further replies.

swaggel1

Technical User
Jun 19, 2001
34
0
0
US
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!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top