
Tips.Net > WordTips Home > Macros > Running Macros from Macros
Summary: Need to run one macro from within another macro? You can easily do it by using the Run method of the Application object, as described in this tip. (This tip works with Microsoft Word 97, Word 2000, Word 2002, Word 2003, and Word 2007.)
There may be times that you need to run a macro from within a macro using VBA. For instance, suppose you have a macro that creates a new document based on a template, and then runs a macro in that template. This is a relatively straightforward task; one way to handle it is to use the .Run method of the Application object. The command line to use this approach would be as follows:
Application.Run MacroName:="MyMacro"
Provided that there is no ambiguity on the macro name (there are no other macros in any open document or template with the same name), this approach will work just fine. A more elegant solution would be to specify the unambiguous name of the macro, as described in the next tip.
Tip #1390 applies to Microsoft Word versions: 97 2000 2002 2003 2007
Save Time! You can have this tip (and several hundred just like it) in the WordTips annual archives. Imagine having over 400 tips available at your fingertips, in each annual volume.
Uncover how you can master the full potential of printing your documents. Everything you wanted to know about printing and printers, using Word. (more information...)
Ask a Word Question
Make a Comment
Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Pet Tips
Word2007 Tips
WordTips