Syntax
DisableAutoMacros [Disable]
Remarks
Disables AutoOpen, AutoClose, AutoNew, and AutoExit macros until they are re-enabled with the instruction DisableAutoMacros 0 or until Word is started again. You can place a DisableAutoMacros statement before the line in your macro that triggers an auto macro — for example, a FileNew instruction that creates a document based on a template containing an AutoNew macro.
Argument | Explanation | |
Disable | Specifies whether to disable auto macros: 0 (zero) Enables auto macros 1 or omitted Disables auto macros |
You cannot use DisableAutoMacros to disable an AutoExec macro or to disable the current macro. For example, you could not place a DisableAutoMacros statement in an AutoOpen macro to disable AutoOpen. To disable an AutoExec macro, hold down the SHIFT key while Word is loading or use the /m startup switch. For more information, see "Startup Switches" in Help.
Example
This example creates a new document based on the Memo template. Assume that the Memo template contains an AutoNew macro that presents a series of dialog boxes. The DisableAutoMacros statement prevents AutoNew from running.
DisableAutoMacros FileNew .Template = "MEMO"