Sommaire

Creating a Macro

A Macro saves a series of commands as a single command in order to automate your work in Word. A Macro is written in the Visual Basic programming language. Macros are stored in the document or in a document template.

If you want to save the Macro in a particular document or template, open that document (for a template, you can open a document based on that template).

Click the Developer tab, go to the Code group and click the Record Macro button, or click the images/IC-066.png icon on the status bar.

Enter then name you want to give the Macro in the Macro name box.

In the Store macro in list, give the name of the document or template in which the Macro should be saved.

Macros can be saved in the standard template (All Documents (Normal.dotm)), in the active document or in the template on which the active document is based.

If you want, enter a Description.

images/34RBEN01.png

To run your Macro quickly and easily, you can assign a tool button or a keyboard shortcut to it by clicking one of the following buttons:

Button

To place a button for your Macro on the Quick Access Toolbar.

Keyboard

To assign a keyboard shortcut to your Macro.

Click OK.

In the Ribbon, the Record Macro button is replaced by the Stop Recording button. The images/IC-007.png button appears in the status bar.

Perform the actions you want to include in the Macro. If you want to perform an action without recording it, click Pause Recording in the Code group; click Resume Recorder when you are ready.

When you have performed all the necessary actions, click the Stop Recording button in the Code group ...