Article ID: 252427 - View products that this article applies to.
This article describes how you can assign an Outlook Visual Basic for Applications macro to a shortcut key.
You can create Visual Basic for Applications macros that use the Outlook object model to perform certain tasks. You can assign the macro to a shortcut key to easily run the macro at any time.
It is important to keep in mind that unlike other Microsoft Office programs, Outlook does not directly contain a feature that lets you customize shortcut keys. However, you can assign shortcut keys to Outlook menus and toolbars. Either of the following two approaches may satisfy your needs.
Use the Shortcut Keys for MenusYou can customize the toolbar or a menu by adding a macro.
For additional information about how to add a macro to a toolbar or menu, click the article number below to view the article in the Microsoft Knowledge Base:
252426When you add the macro to the menu, be sure to precede one of the letters in the name with an ampersand (&). This makes that letter a shortcut key and the letter appears underlined on the menu. You can run the macro by using two separate key combinations, the first to select the menu, and the second to run the macro on the menu.
(http://support.microsoft.com/kb/252426/EN-US/ )OL2000: How to Assign a Macro to a Toolbar Button
For example, assume that you create a macro to do a search and replace operation on your contacts. You name the macro "UpdateContacts," add the macro to the Tools menu, and specify that the name of the menu command is "Upd&ate Contacts." Note the ampersand precedes the letter "a" in the name that will appear on the menu. To run this macro using the keyboard, use two key combinations. First, press ALT+T to open the Tools menu, and then press A to run the macro.
Use the Shortcut Keys for Toolbar ButtonsThe only way to use a single shortcut key is to use the above approach, but add the command or button to a toolbar, instead of a menu. This method can have some adverse side effects and must be implemented carefully and with the expectation that you may not be successful.
The following issues should be taken into account:
For additional information about available resources and answersto commonly asked questions about Microsoft Outlook solutions, click the article number below to view the article in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/146636/EN-US/ )OL2000: Questions About Custom Forms and Outlook Solutions