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 INFORMATIONRecord a Macro
To record a macro with PowerPoint, follow these steps:
- 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 recording a macro, the Stop
Recording menu choice is available instead of the Record New Macro option.
- 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
- 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.
- 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.
- 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:
- On the Tools menu, point to Macro, and then click Macros. The Macro dialog box appears.
- 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.
- 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:
- On the Tools menu, point to Macro, and then click Macros. The Macro dialog box appears.
- Click the macro you want to delete.
- Click Delete.
- 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
|