Word.Tips.Net Welcome toWord.Tips.Net

Helpful Links

Tips.Net Home
WordTips Home

Ask a Word Question
Make a Comment

Tips.Net Store

WordTips FAQ
WordTips Premium

Learn Access Now
Free Printable Forms

Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Legal Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Wedding Tips
Word2007 Tips
WordTips

Advertise on the
WordTips Site

Newest Tips

Arranging Document Windows

Specifying a Backup Location

Controlling Chart Gridlines

Merging Table Cells

Collapsing and Expanding Subdocuments

Zooming With the Keyboard

Initiating a New Search

 

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

Create Rock-Solid Lists! Bulleted and numbered lists can help make your writing clearer and easier to follow. If not done properly, however, they can be a nightmare to work with. Discover the ins and outs of Word's lists with this great reference available in two versions.
 
Check out Word Bullets and Numbering today!