Capturing user Keypress in Outlook VBA

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.
 
S

Sue Mosher [MVP-Outlook]

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.
 
P

Praveen Mishra

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.
 
S

Sue Mosher [MVP-Outlook]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top