Hardware

Document your custom keyboard shortcuts

Users can easily create custom keyboard shortcuts -- but they don't always remember which commands they've assigned to which keys. Here's a look at how you can produce a list of those shortcuts.

Shortcut keys give you quick access to menu and toolbar commands, macros, styles, and other often-used tasks. Instead of working your way through a menu hierarchy, you simply press [Alt]+key. For instance, if you want to display the File menu, you can click the File menu or you can press [Alt]+F. You can spot these built-in shortcuts because the appropriate key is underlined. Word users quickly become familiar with the shortcuts they use. (Many shortcut keys use [Ctrl] instead; e.g., to enable Bold, press [Ctrl]+B.) Word has done a good job of anticipating the commands users need the most, but you can create custom shortcuts when none exists. To do so:

  1. Right-click the menu or toolbar (the background, not a menu or icon).
  2. Choose Customize.
  3. Click Keyboard at the bottom of the Customize dialog box.
  4. In the Categories list, choose the menu or toolbar that contains the command you want to automate.
  5. In the Commands list, select the command you're automating.
  6. If a shortcut already exists for the selected command, Word will display it in the Current Keys list (there's often more than one).
  7. Click inside the Press New Shortcut Key field and then press the keys to assign to the shortcut. Be careful when adding a new combination. If you enter a combination that's in use, Word will give precedence to your new combination and delete the existing one.
  8. Be sure to specify whether you want to save the new shortcut in the Normal.dot (template) or the current document.
  9. Click Assign.
  10. Click Close twice and save the document.
Most users are familiar with the feature. And because this feature is so convenient and easy to implement, the number of shortcuts can quickly grow out of control. If your users are overwhelmed by all the shortcuts they've created, you can document those shortcuts. To print a list of shortcuts, do the following:

  1. From the Tools menu, choose Macro and select Macros.
  2. From the Macros In drop-down list, select Word Commands.
  3. In the Macro Name list, select ListCommands.
  4. Click Run.
  5. In the resulting List Commands dialog box, click the Current Menu And Keyboard settings.
  6. Click OK and Word will print a full list of the existing keyboard shortcuts.
Now, in a document that's built on the built-in template (Normal.dot), there are about nine pages of shortcuts. It might be great for your purposes, but it won't help your users find their custom shortcuts. Fortunately, VBA can help. The following macro will print custom keyboard shortcuts to the Immediate window. Sub DocumentKeys()

'Print custom keyboard shortcuts to

'Immediate window.

Dim aKey As KeyBinding

Debug.Print "Count of custom " _

& " shortcut keys is " _

& KeyBindings.Count

For Each aKey In KeyBindings

Debug.Print aKey.Command & vbTab & _

aKey.KeyString & vbCr

Next aKey

End Sub
If you'd rather save or print the list, this next macro prints the list to a new document: Sub PrintKeys()

'Print custom keyboard shortcuts to new document.

Dim aKey As KeyBinding

Documents.Add , , wdNewBlankDocument

Debug.Print "Count of custom " _

& " shortcut keys is " _

& KeyBindings.Count

For Each aKey In KeyBindings

Selection.InsertAfter aKey.Command _

& vbTab & aKey.KeyString & vbCr

Next aKey

End Sub

Both macros loop through the KeyBindings collection and print the Command and KeyString property for each existing KeyBinding object in the collection. (Macros are for Word 2003.)

About Susan Harkins

Susan Sales Harkins is an IT consultant, specializing in desktop solutions. Previously, she was editor in chief for The Cobb Group, the world's largest publisher of technical journals.

Editor's Picks

Free Newsletters, In your Inbox