MS-Word

Macros

¨ Recording a macro
You record a macro just as you record music with a tape recorder. Then you run the macro to repeat, or “play back,” the commands. PowerPoint records a macro as a series of PowerPoint commands in Visual Basic for Applications.
When you record a macro, you can use the mouse to click commands and options, but the macro recorder doesn’t record mouse movements in a presentation window. For example, you can’t use the mouse to move the insertion point or to select text by clicking or dragging. You must use the keyboard to record these actions.
Steps for recording the macros
1. On the Tools menu, point to Macro, and then click Record New Macro. 

wpeB.gif (3524 bytes)
(Figure 4.1)

2. In the Macro name box, enter a name for the macro. 

4.2.JPG (22321 bytes)
(Figure 4.2)

The first character of the name must be a letter. Other characters can be letters, numbers, or the underscore character. Because spaces aren’t allowed in a macro name, an underscore works well as a word separator. 
3. To change the description of the macro, edit the information in the Description box.
4. Click OK.
5. Carry out the actions you want to record.
6. To stop recording your macro, click Stop Recording on the Stop Recording toolbar.
¨ Writing a macro
You can also use the Visual Basic Editor to create very flexible, powerful macros that include Visual Basic instructions that you cannot record. In the Visual Basic Editor, you can edit macros, copy macros from one module to another, copy macros between presentations, rename the modules that store macros, and export modules. The Visual Basic Editor comes with its own Help file.
¨ Edit a macro
1. On the Tools menu, point to Macro, and then click Macros. 
2. In the Macro name box, select the macro you want to Edit.
3. Click Edit. 
The macro opens in the Visual Basic Editor, where you can make corrections, remove unnecessary steps, or add instructions you can’t record in PowerPoint. 
The Visual Basic Editor comes with its own Help file, so you can get help there.
¨ Run a macro
1. Open the presentation that contains the macro.
2. On the Tools menu, point to Macro, and then click Macros.
3. In the Macro name box, enter the name of the macro you want to run.
4. Click Run
5. Select the lines of the macro you want to copy. To copy the entire macro, make sure to include the Sub and End Sub lines in the selection. 
6. Click Copy 
7. Switch to the module where you want to place the macro you copied.
8. Click Paste
¨ Delete a macro
1. On the Tools menu, point to Macro, and then click Macros.
2. In the Macro name box, click the name of the macro that you want to delete.
3. Click Delete.

Back to Index