Microsoft KB Archive/161974

= PPT97: How to Record a Macro using PowerPoint 97 =

Article ID: 161974

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft PowerPoint 97 Standard Edition

-



This article was previously published under Q161974



SUMMARY
With PowerPoint 97 you can create macros to automate tasks you perform repeatedly. 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 using the macro recorder.



Record a Macro
Follow these steps to record a macro with PowerPoint 97:

 Open or create a PowerPoint Presentation. You cannot record a macro unless a presentation is open. On the Tools menu, point to Macro, and then click Record New Macro. This opens the Record Macro dialog box.

NOTE: If you are currently recording a macro, you see the Stop Recording menu choice instead of the Record New Macro option. In the Macro name box, enter 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 can contain up to 80 letters. The name cannot contain any spaces. Visual Basic for Applications keywords are invalid names for macros.

Don't worry about trying to remember all the rules for naming macros. If you enter an invalid macro name, PowerPoint 97 displays a dialog box with a message similar to the following:

is not a valid name for a macro

 Use the Store Macro In drop down list to select the location in which to save your macro. The default location is the active presentation. Normally, you would save macros within presentations. 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. 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. 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.</li> When done with the actions, stop recording the macro. You can do this in two ways:

<ul> Click the square button located on the Stop Recording command bar. -or-

</li> On the Tools menu, point to Macro, and then click Stop Recording.</li></ul> </li></ol>

Run a Macro
After you have created a macro, you'll want to run it. Use the following steps to run a macro within PowerPoint 97:


 * 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 you do not see your macro listed, one of two things may be happening:


 * 1) * The presentation where the macro resides is not open. Open the presentation that contains your macro and try again.
 * 2) * A presentation that does not contain your macro is selected on the Macro In drop down list. Click the drop down 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.
 * 1) With the macro you wish to run highlighted, click the run button.

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

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

For more information about macro viruses, search the Help Index for "virus protection," or ask the Microsoft PowerPoint 97 Office Assistant.

How to Delete a Macro
Follow these steps to delete a macro from a PowerPoint presentation:

<ol> On the Tools menu, point to Macro, and then click Macros. This brings up the Macro dialog box.</li> Click the macro you wish to delete.</li> Click the Delete button.</li> PowerPoint displays a dialog box similar to the following:

Are you sure you want to delete the macro ?

Click Yes to delete the macro.</li></ol>

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 basically 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 article in the Microsoft Knowledge Base:

161663 PPT97: Macro Recorder Doesn't Record Find or Replace Commands

Additional query words: 97 8.00 kbmacro ppt8 vba vbe

Keywords: kbcode kbdtacode kbhowto kbmacro kbprogramming KB161974

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.