Copying Macros to Other Templates or Documents

3 4

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 40-10 shows the Organizer dialog box with the NewMacros macro project stored in the Normal template.

    figure 40-10. you can use the organizer dialog box to copy, delete, and rename macro projects.

    Figure 40-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, display the desired documents or templates by clicking Close File and then clicking Open File to find and open the desired document or template.
  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.

Tip


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 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.



Microsoft Word Version 2002 Inside Out
Microsoft Word Version 2002 Inside Out (Inside Out (Microsoft))
ISBN: 0735612781
EAN: 2147483647
Year: 2005
Pages: 337

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