Creating Macros That Run Automatically

In most cases, you should give your macro a name that describes its function so that you can easily remember its purpose later. There are, however, several special names you can give your macros. These names cause your macros to run automatically when certain events occur in Word:

  • A macro named AutoExec runs when you start Word. For this macro to work, you need to store it in your Normal.dot template or another global template.

    NOTE

    The capitalization used in this discussion isn't required; autoexec and Autoexec will work the same way as AutoExec. You cannot, however, give this function a completely new name.

  • A macro named AutoExit runs when you exit Word. If you want a macro to run every time you exit Word, ...

Get Special Edition Using® Microsoft® Office Word 2003 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.