# Recording a Macro

/text/shared/guide/macro_recording.xhp
macros; recording
recording; macros
Basic; recording macros
Recording a Macro
- Open the document for which you want to record a macro.
- Choose Tools - Macros - Record Macro.
  You see the small Recording dialog with just one button called Stop Recording.
- Perform the actions you want to be recorded in the document.
  Press the Escape key to deselect an object, as the macro recorder currently does not record this action by mouse click.
- Click Stop Recording.
  The Macro dialog appears, in which you can save and run the macro.
  If you want to abort the recording without saving a macro, click the Close button of the Recording dialog.
- To save the macro, first select the object where you want the macro to be saved in the Save macro in list box.
- If you want the macro to be saved into a new library or module, click the New Library or New Module button and enter a name for the library or module.
- Enter a name for the new macro in the Macro name text box. Do not use Basic keywords as a name.
- Click Save.
Limitations of the macro recorder
The following actions are not recorded:
- Opening of windows is not recorded.
- Actions carried out in another window than where the recorder was started are not recorded.
- Window switching is not recorded.
- Actions that are not related to the document contents are not recorded. For example, changes made in the Options dialog, macro organizer, customizing.
- Selections are recorded only if they are done by using the keyboard (cursor traveling), but not when the mouse is used.
- The macro recorder works only in Calc and Writer.
Macro
Programming in %PRODUCTNAME
how-to running a macro
how-to testing and debugging a macro
The macro recording functionality is only available for text documents in %PRODUCTNAME Writer and for spreadsheets in %PRODUCTNAME Calc.