Macros in MS Word

Last Updated : 6 Apr, 2026

A macro in Microsoft Word is a recorded sequence of commands or actions that automates repetitive tasks. It is created using the Developer tab’s Record Macro feature, which captures actions like formatting text or inserting objects and allows them to be replayed later.

Key Features

  • Record and Replay: Capture a sequence of actions (e.g., formatting text) and replay them with a single command.
  • Customizable Triggers: Assign macros to keyboard shortcuts or buttons for quick access.
  • Document-Specific or Global: Save macros to a specific document or the Normal template for universal use.

Example: Record a macro to apply consistent heading styles across a report.

Steps to Use Macros

Step 1. Enable the Developer Tab

Screenshot-2025-09-08-113027

Step 2. Record a Macro

Start Recording:

  • Go to Developer > Code group > Record Macro (or View > Macros > Record Macro).
Screenshot-2025-09-08-131023
  • In the Record Macro dialog box:
    • Enter a Macro name (e.g., “FormatText”) , name must start with a letter and cannot begin with a number, contain spaces or special characters.
    Screenshot-2025-09-08-131156
    • Choose where to store:
      • All Documents (Normal.dotm): Available in all Word documents.
      • This Document: Available only in the current document.
      Screenshot-2025-09-08-131243
    • Assign a trigger (optional):
      • Button: Add to the Quick Access Toolbar.
      • Keyboard: Assign a shortcut.
      Screenshot-2025-09-08-131436
    • Click OK to start recording.
  • Perform the desired actions (e.g., change font size, apply bold, insert a table).
  • Click Developer > Stop Recording (or View > Macros > Stop Recording) to finish.
Screenshot-2025-09-08-131621-min

Step 3. Run a Macro

Execute a Macro:

  • Go to Developer > Macros (or View > Macros > View Macros).
  • In the Macros dialog box, select the macro (e.g., “FormatText”) and click Run.
Screenshot-2025-09-08-131836
  • Alternatively, use the assigned keyboard shortcut or Quick Access Toolbar button.

Apply to Text or Document:

  • Select the text or place the cursor where the macro should apply before running it.
Screenshot-2025-09-08-131959

Step 4. Manage Macros

View and Delete Macros:

  • Go to Developer > Macros > View Macros.
  • Select a macro and click Delete to remove it, or Organizer to copy macros between documents or templates.
Screenshot-2025-09-08-144728

Save Macro-Enabled Documents:

  • Save documents with macros as Word Macro-Enabled Document (*.docm) via File > Save As to preserve macro functionality.
Comment