The Macro dialog box is a centralized location for managing your presentation macros. You can view, run, edit, step into, create, or delete macros. To view all the macros in your presentation, open the Macro dialog box by choosing Tools, Macro, Macros from the menu. Or, you can open the Macro dialog box quickly, shown in Figure 31.1, by pressing Alt+F8 while you're in any presentation view (Slide, Outline, Slide Sorter, or Notes Page). Figure 31.1. The Macro dialog box shows the macros that are available to use in a presentation.
If you have opened a blank presentation without selecting any special templates, the Macro dialog box doesn't list any macros. PowerPoint has three methods you can use to add macros to a presentation file:
Copying existing macros from sample code files is a quick way to become familiar with the power and flexibility of the Visual Basic for Applications language. The section "Finding More Macro Information," later in this chapter, will teach you the steps for finding a wealth of sample code available from the Microsoft Web site. Creating MacrosThe easiest way to create a macro is to record the keystrokes as you replicate the task you want to automate. To record a new macro, follow these steps:
Running a MacroAfter you have created a macro, you can run it at any time. Running a macro means executing the programming commands within the macro. There are two ways to run a macro: You can use the menu, or add a button to a toolbar that represents the macro. To run the macro from the menu, use the following steps:
To quickly access and run a PowerPoint macro with a single click, you may want to attach it to a button on either a built-in or custom toolbar. You can then run the macro by clicking the toolbar button. To add a macro button to a toolbar, use the following steps:
After you have added a macro button to a toolbar, you may want to customize the button's display attributes so that it is a small icon instead of the macro name. To add a macro button to a toolbar, use the following steps:
To remove a macro button from a toolbar (but not delete the macro), use the following steps:
Deleting MacrosIn PowerPoint, you can also remove unused macros. If you frequently use pre-existing macro templates, you might want to delete the unused macros to conserve memory resources. Here's how to delete a macro:
The macro is then deleted from the presentation file. Using Pre-existing Template MacrosMacros can be stored in presentation template files and " copied " into your existing presentation. To use template macros in a presentation, you need to create the presentation from the pre-existing template. Follow these steps to embed template macros in your presentation:
If you have already built slides that you want to include in the new presentation, add them to the newly created presentation by choosing Insert, Slides from Files from the menu.
|