Copying Macros to Other Templates or Documents

 < Day Day Up > 



When you create macros in a document or template, Word stores the macros as a single macro project. Simply stated, a macro project is a collection of macros grouped under one name and stored as a single entity in a document or template. Each document or template has one macro project that contains all the macros you've created for that document or template. By default, when you record macros, Word stores the VBA code in a macro project named NewMacros. You can manipulate a macro project in a number of ways by using the Organizer. For instance, you can copy a macro project from one document or template to another document or template, you can delete a macro project, or you can rename it.

In this section, we'll look at copying macro projects to other documents or templates by using the Organizer. To do so, follow these steps:

  1. Choose Tools, Macro, Macros (or press Alt+F8) to open the Macros dialog box.

  2. Click Organizer, and then click the Macro Project Items tab. Figure 32-10 shows the Organizer dialog box with a macro project called NewMacros stored in the Normal template.

    click to expand
    Figure 32-10: You can use the Organizer dialog box to copy, delete, and rename macro projects.

  3. To copy the macro project from a template or document, click Close File and then click Open File to find and open the desired documents or templates.

  4. Click the macro project you want to copy (in whichever list the item appears), and then click Copy to copy the macro project to the other currently displayed document or template (which should appear in the other list).

  5. Click Close to close the Organizer dialog box.

    Note 

    If you have assigned macros to toolbars, you should also copy the toolbars by using the Toolbars tab in the Organizer dialog box. When you copy toolbars, you must also copy the macro project; otherwise, the toolbar buttons won't work.

When you copy a macro project to another document or template, you copy all the macros you've created to the other file. After you copy a macro project to another file, you can open the Macros dialog box in that file to edit, delete, or add individual macros.



 < Day Day Up > 



Microsoft Office Word 2003 Inside Out
Microsoft Office Word 2003 Inside Out (Bpg-Inside Out)
ISBN: 0735615152
EAN: 2147483647
Year: 2005
Pages: 373

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net