Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback. This video shows a method that does NOT require VBA coding. This is possible through the power of macros. In a macro that might trigger an auto macro, you can use the following instruction to prevent auto macros from running. Learn how to automate tasks in Microsoft Word that you perform over and over. For example, if you create a new document based on a template that contains an AutoNew macro, you can prevent the AutoNew macro from running by holding down the SHIFT key when you click OK in the New dialog box ( File menu) and continuing to hold down the SHIFT key until the new document is displayed. Note You can hold down the SHIFT key to prevent auto macros from running. If you create an AutoNew macro in the normal template, the macro will run if a macro named AutoNew does not exist in the document or the attached template. For example, if you create an AutoClose macro in a document and in the attached template, only the auto macro stored in the document will execute. In the case of a naming conflict (multiple auto macros with the same name), Word runs the auto macro stored in the closest context. The only exception is the AutoExec macro, which will not run automatically unless it is stored in one of the following: the Normal template, a template that is loaded globally through the Templates and Add-Ins dialog box, or a global template stored in the folder specified as the Startup folder. The module is named after the auto macro. Auto macros in code modules are recognized if either of the following conditions are true. You can record events such as keystrokes, mouse clicks, and delays between actions. In the Name box, type the name of the new macro. An empty macro is created and added to the macro list. Perform the actions you want to be recorded in the document. In the list under the button that you want to reassign, select Macro. Word recognizes the following names as automatic macros, or 'auto' macros. Open the document for which you want to record a macro. In order for an auto macro to run, it must be either in the Normal template, in the active document, or in the template on which the active document is based. By giving a macro a special name, you can run it automatically when you perform an operation such as starting Word or opening a document. Just like other macros, auto macros can be stored in the Normal template, another template, or a document. The module is named after the auto macro (for example, AutoExec) and it contains a procedure named "Main."Ī procedure in any module is named after the auto macro. When you exit Word or unload a global templateĪuto macros in code modules are recognized if either of the following conditions are true. When you start Word or load a global template Word recognizes the following names as automatic macros, or "auto" macros. By giving a macro a special name, you can run it automatically when you perform an operation such as starting Word or opening a document.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |