PowerPoint.Advanced.Presentation.Techniques [Electronic resources]

Faithe Wempen

نسخه متنی -صفحه : 231/ 190
نمايش فراداده

Reusing Macros in Multiple Presentations

A macro usually runs only in the presentation in which it is stored, or in all open presentations. If you create a macro in one presentation and then close that presentation, the macro is usually not available anymore.

To correct this, you can copy the macro to the other presentation. Macro security must be set to Medium or Low in order to do this.

Open both presentations, and then open the Visual Basic Editor. In the Project Explorer pane (top left corner), drag Module 1 from the presentation containing the macros to the presentation that should receive them (see Figure 19-9).

Figure 19-9: Copy macro modules from one presentation file to another.

If you want to copy macros into another presentation but the target presentation is not available on the same PC, you can export the macro module into a separate, free-standing file and import that file to the target presentation later. When you do this, you save the macros in a Visual Basic file (with a .BAS extension).

To export a macro module, open the presentation containing the macros in PowerPoint and then open the Visual Basic Editor. Right-click Module 1 in the Project Explorer pane (top left) and choose Export File. Enter a name and location, and click Save.

To import the macro module somewhere else, open that presentation in PowerPoint and then open the Visual Basic Editor. Right-click the presentation file in the Project Explorer pane and choose Import File. Select the file and click Open.