<p>How can I assign a keyboard shortcut to a VBA macro in Outlook 2007?</p>

<p>I know how to create a tool for the macro and put it in a menu with an underscore shortcut. This solution requires me to use a shortcut of <kbd>Alt</kbd> + <kbd>{menu key}</kbd> + <kbd>{tool key}</kbd>. What if I want to assign it to <kbd>Alt</kbd> + <kbd>F12</kbd> or something like that?</p>

<p>The Visual Basic Editor is assigned to the keyboard shortcut <kbd>Alt</kbd> + <kbd>F11</kbd> in Outlook 2007. I want to assign a keyboard shortcut like that to a macro, or if necessary a macro on a tool in either a menu or a toolbar.</p>

[{'answer_id': 57175, 'author': 'rpetrich', 'author_id': 4007, 'author_profile': 'https://Stackoverflow.com/users/4007', 'pm_score': 3, 'selected': False, 'text': '<p>Since Outlook doesn\'t have the OnKey event, the easiest way is to assign a toolbar button to the macro and put an ampersand in its name somewhere. This only works if your shortcut letter doesn\'t conflict with an existing shortcut.</p>\n\n<p>You may also have luck with setting a global hotkey, but it\'s usually more pain then it\'s worth:</p>\n\n<p><a href="http://www.mvps.org/vbvision/_samples/HotKey_Demo.zip" rel="noreferrer">http://www.mvps.org/vbvision/_samples/HotKey_Demo.zip</a></p>\n'}, {'answer_id': 595309, 'author': 'guillermooo', 'author_id': 1670, 'author_profile': 'https://Stackoverflow.com/users/1670', 'pm_score': 3, 'selected': True, 'text': '<p>The article <a href="http://msdn.microsoft.com/en-us/library/aa155749(office.10).aspx" rel="nofollow noreferrer">Do-It-Yourself IntelliSense</a> from MSDN provides excellent information about key bindings in VBA.</p>\n'}]
['https://Stackoverflow.com/questions/57075', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/966/']