PPT2000: How to Record a Macro using PowerPoint

ID: Q222775


The information in this article applies to:
  • Microsoft PowerPoint 2000


SUMMARY

With PowerPoint, you can create macros to automate tasks you perform. A macro is basically a list of commands for PowerPoint to perform.

One method to create a macro is to record the commands using the PowerPoint built-in macro recorder. This introductory article includes the steps to record, run, and delete macros.

This article also contains some information on where macros are stored and some limitations of macros created when you use the macro recorder.


MORE INFORMATION

Record a Macro

To record a macro with PowerPoint, follow these steps:
  1. Open or create a PowerPoint Presentation. You cannot record a macro unless a presentation is open.


  2. On the Tools menu, point to Macro, and then click Record New Macro. This opens the Record Macro dialog box.

    NOTE: If you are recording a macro, the Stop Recording menu choice is available instead of the Record New Macro option.


  3. In the Macro name box, type a name for your macro. The default macro name is the word Macro followed by a number. The name must begin with a letter and may contain up to 80 letters. The name cannot contain any spaces. Visual Basic for Applications keywords are invalid names for macros.

    Do not worry about trying to remember all the rules for naming macros. If you enter an invalid macro name, PowerPoint displays a dialog box with a message similar to the following:
    <macro name> is not a valid name for a macro


  4. Use the Store Macro In list to select the location to save your macro. The default location is the active presentation. Normally, you would save macros within presentations.


  5. Use the Description box to type a description of what your macro does. The description is important. Once you build up a collection of macros without descriptions, it may be very difficult to determine what any particular macro does.


  6. Once you have the Record Macro settings configured, click OK. This brings up the Stop Recording command bar. The command bar contains one square button. This button is used to stop the macro from recording.


  7. Carry out the actions you want to record.

    NOTE: Some actions may not be recorded by the macro recorder. PowerPoint records a command only when an equivalent Visual Basic for Applications command exists within PowerPoint's object model. The object model is a set of commands that you can use to control PowerPoint.


  8. When you complete the actions, stop recording the macro. To do this, use one of the following methods:

    - Click the square button located on the Stop Recording command bar.
    -or-
    - On the Tools menu, point to Macro, and then click Stop Recording.


Run a Macro

After you create it, run the macro. To do this, follow these steps:
  1. On the Tools menu, point to Macro, and then click Macros. The Macro dialog box appears.


  2. Click a macro from the list of available macros. If your macro is not listed, one of the following may be true:
    - The presentation where the macro resides is not open. Open the presentation that contains your macro, and try again.
    - A presentation that does not contain your macro is selected on the Macro In list. Click the menu to view a list of open presentations. Select the presentation that contains your macro and try again.
    NOTE: You can select the All open presentations option to view all the macros currently available.


  3. With the macro you want to run selected, click Run.


Where Macros Are Stored

Macros created within PowerPoint are typically stored within PowerPoint presentations. When you save your file as a PowerPoint presentation, your macro is saved along with it.

When you open a presentation that contains macros while Macro Virus Protection is enabled, a warning dialog box is displayed. This dialog box gives you the option to enable or disable the macros that reside within the presentation you are about to open.

How to Delete a Macro

To delete a macro from a PowerPoint presentation, follow these steps:
  1. On the Tools menu, point to Macro, and then click Macros. The Macro dialog box appears.


  2. Click the macro you want to delete.


  3. Click Delete.


  4. PowerPoint displays a dialog box similar to the following:
    Are you sure you want to delete the macro <macro name>?
    Click Yes to delete the macro.


Limitations of Recorded Macros

Not all features in PowerPoint can be recorded. PowerPoint records a command only when an equivalent Visual Basic for Applications command exists within PowerPoint's object model. The object model is a set of commands that you can use to control PowerPoint.

PowerPoint suspends its recording of commands when you switch to a different application. When you return, PowerPoint picks up where it left off and continues to record commands.

For more information about the limitations of recorded macros, please see the following articles in the Microsoft Knowledge Base:
Q222779 PPT2000: Macro Recorder Doesn't Record Find or Replace Commands
Q222710 PPT2000: Macro Recorder Does Not Record Increase or Decrease Font
Q222704 PPT2000: Macro Recorder Does Not Record Show Command
Q222796 PPT2000: Macro Recorder Doesn't Record Activating Placeholder
Q222707 PPT2000: Macro Recorder Doesn't Record Changes to Links Dialog Box
Q222711 PPT2000: Macro Recorder Doesn't Record Code Moving Command Bars
Q222721 PPT2000: Paste Special Not Available in PowerPoint Object Model

Additional query words: 9.00 ppt9 vba vbe ppt2k powerpt vba2k ppt9.0 ppt2000 program programming

Keywords : kbcode kbmacro kbprg kbdta kbdtacode kbpptvba
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbhowto


Last Reviewed: July 14, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.