Capturing user Keypress in Outlook VBA

  • Thread starter Thread starter Praveen Mishra
  • Start date Start date
P

Praveen Mishra

Hi All,

Is there any way in Outlook VBA to capture the key pressed by the user and
take action accordingly, i.e. running a macro or executing a script.

Thanks in advance for the response.
 
Outlook has no events for keypresses. If you explain in more detail what you're trying to do, we might be able to come up with a solution.
 
Hi Sue,

Thanks for your quick response. What I am trying to do is create shortcuts
for some commandbar options, like changing flag colors e.g. by pressing 'F8'
button as it is not used for any other option. As you would understand, this
would require me to capture the key pressed by the user and then take
appropriate action. Do let me know in case there is any other way to handle
this.

Regards,
Praveen Mishra.
 
There are various third-party tools for capturing keypresses and, of course, the Windows API. But if you want something native to Outlook, the closest you can come is assigning a macro to a toolbar button and then changing the button's caption to add an Alt+ accelerator by inserting a & before the accelerator character.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 
Back
Top