|
|
|
|
Example: Assigning macros to shortcut keys
A common use for assigning macros to shortcut keys is to enable quick and easy insertion of special characters. This example shows how to st up keyboard shortcuts for inserting en-dashes and em-dashes.
First, you need to record a macro for inserting each type of dash. Then, you need to assign those macro to shortcut key combinations.
- Use Tools > Macros > Record Macro to start recording a macro.
A small window is displayed so you know that OpenOffice.org is recording.
- Use Insert > Special Characters to open the Special Characters dialog box. Scroll down until you find the en-dash (U+2013) and em-dash (U+2014) characters. Select one of them and click OK.
Find and choose the en-dash.
- Click the Stop Recording button to stop recording, save the macro, and display the OpenOffice.org Basic Macros dialog. Type a descriptive name for the new macro in the Macro name box on the upper left.
Naming the new macro and storing it.
- Be sure to open the library container named My Macros. Find the library named Standard under My Macros. Select Module1 and click Save.
- Repeat steps 1–4 to create other macros, for example to insert an em-dash.
- Use Tools > Customize > Keyboard tab. In the Shortcut keys list, pick an unused combination (for example, Ctrl+Shift+N for an en-dash). In the Category list, scroll down to OpenOffice.org Macros, click the + sign, then click the + next to the Standard library and choose Module1. In the Function list, choose Endash and click the Modify button on the upper right. The selected key combination now appears in the Keys list on the lower right, and Endash appears next to Ctrl+Shift+N in the Shortcut keys list.
Defining keyboard shortcuts for running macros.
- Repeat for the em-dash macro, then click OK.
|
|
|