How do I:
-
add button to my ms word 2007 document (i would say this would be trivial task, but can’t even figure THIS out)
-
handle click event of this button in my VBA script
-
set text of my text control (with tag “text1”)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t know if it is what you intended, but to add a button in the document, open the Developer tab. Click the
Legacy toolsfolder (in the Controls group) and click theCommand Button (Active X Control). This will put a button in the document and make Word go into design mode.Double-click the new button and you will enter the VBA editor in the event handler for the button.
Enter code to manipulate the text in TextBox1:
Click the design mode button to exit design mode, and you’re good to go; click the new button to set the text.
If you meant to add a button in the ribbon? A little more complicated, but not that hard. Leave a comment, and I’m sure we can work it out as well.