Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, and 2016. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Automatically Running a Macro.
by Allen Wyatt
(last updated June 26, 2018)
You know that you can create macros within Word that allow you to automate many different functions. You may not know, however, that you can create macros that perform tasks without any intervention on your part. For instance, you can create a macro that Word will run automatically whenever you create a document; whenever you use the New command, this macro will run.
These special macros that automatically run at predefined times are identified by special names. Otherwise, there is nothing different between these macros and any other you may write. Here are the names you can give macros so that they will run automatically.
|Macro Name||When It Runs|
|AutoNew||Whenever you create a new document|
|AutoClose||Whenever you close a document|
|AutoExec||Whenever you start Word|
|AutoExit||Whenever you exit the program|
|AutoOpen||Whenever you open a document|
Remember that these macros, in order to be used effectively, must be saved within a DOCM document. (That is, within a document that is "macro enabled.") They cannot be saved in a DOCX document, as such documents cannot contain macros at all.
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (9388) applies to Microsoft Word 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Word here: Automatically Running a Macro.
The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!
A great place for your macro to display status information is, well, in the status bar. Displaying the information is ...Discover More
Got a macro that processes or uses styles? You definitely need to know how many styles Word has available in the ...Discover More
Using a macro to format your document (or portions of your document) is not all that uncommon. If you want your macro to ...Discover More
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.