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!

Run Word Macro

Status
Not open for further replies.

DeeDee

Programmer
Jul 13, 2000
34
0
0
US
I have a command button on a word document that when it is clicked, I need it to run a macro that I have already recorded. Can anyone tell me the code for doing that? Thanks in advance!
 
On the Control Toolbox toolbar, click the "Design Mode" icon (the very first one) to enter design mode. Then right-click on your button and select "View code" from the popup menu. You'll be taken to the commandbutton1_click (name may be different) sub, where you can enter the code to be executed. You could put a simple call to your existing macro here, or copy the macro code into this event handler.
Then turn design mode off, and give it a click.
Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top