Assign Shortcuts to LibreOffice Basic Macros

Assigning personalized keyboard shortcuts to LibreOffice Basic macros allows you to execute repetitive automation tasks instantly without navigating through multi-level menus. Whether you are working in LibreOffice Writer, Calc, or Impress, customizing hotkeys significantly improves your workflow. This guide outlines the exact, step-by-step process to map any user-created Basic macro to your preferred keyboard combination.

Step 1: Open the Customize Menu

  1. Launch LibreOffice or the specific document where your macro is stored.
  2. In the top menu bar, click on Tools.
  3. Select Customize… from the dropdown menu to open the customization window.

Step 2: Navigate to the Keyboard Tab

  1. In the Customize dialog box, switch to the Keyboard tab at the top.
  2. In the top-right corner, choose the scope of your shortcut:
    • Select LibreOffice to make the shortcut active across all LibreOffice applications (Writer, Calc, Impress, etc.).
    • Select the specific application (e.g., Writer or Calc) to restrict the shortcut strictly to that program.

Step 3: Locate Your Macro

  1. Look at the bottom section of the window under the Functions area.
  2. In the Category list on the left, scroll down and expand Application Macros or My Macros (depending on where your script is saved).
  3. Expand Standard (or your custom library name), then click the module that contains your macro.
  4. In the middle Function list, click on the specific macro name you want to assign.

Step 4: Choose a Shortcut Key

  1. Scroll through the Shortcut Keys list located in the upper half of the dialog.
  2. Select an available key combination (such as Ctrl+Shift+M or F12).
    • Note: If a key is already assigned to a native command, assigning your macro will overwrite the existing command for that key.

Step 5: Assign and Save

  1. Click the Assign button located in the top-right area of the dialog.
  2. Verify that your macro’s name now appears next to the chosen key combination in the Keys section at the bottom right.
  3. Click OK to apply the changes and close the dialog.

Your custom keyboard shortcut is now active and ready to execute your LibreOffice Basic macro immediately upon pressing the assigned keys.