Solved

How to assign a hot key to a macro in Microsoft Outlook

Posted on 2011-09-03
7
2,326 Views
Last Modified: 2012-05-12
I have the following code:

Sub ChangeCurrentView()
Dim myOlExp As Outlook.Explorer

Set myOlExp = Application.ActiveExplorer
If myOlExp.CurrentView = "Verzonden aan" Then
myOlExp.CurrentView = "Compact"
Else
myOlExp.CurrentView = "Verzonden aan"
End If
End Sub

Open in new window


I want a shortkey like alt+u or ctrl+alt+u or what ever to be bind to this code.

Anyone knows a solution how i can make this?
I am using Outlook 2010.
0
Comment
Question by:RemcoVi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 36477742
Hello Remco, here's a tutorial about macro's in Outlook. There's a part where they set the hotkey to Alt-1, I can't test for you now so can you try and see if you can change to your desired hotkey?
0
 

Author Comment

by:RemcoVi
ID: 36477760
This is not possible in Outlook 2010 i think , because i can't find the toolbar options or anything described in that link you gave.
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 36477771
Ok, just found something here, you can add your code as a button to the quick access toolbar (and you will get an <alt> shortcut automatically).

Click the File tab, click Options to open the Outlook Options dialog box, and then click Quick Access Toolbar, follow steps at "Making Macros Accessible".
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:RemcoVi
ID: 36478329
Problem with this is that the shortcut key is ALT + R -> Y -> 1

Thats not an easy shortcut.
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 36478856
You are correct, this is not a easy shortcut :). I've been looking a bit more into it and it seems that it is not possible to assign custom shortcuts (like alt-u) in Outlook to macro's.

Instead, you could use a tool like Auto Hotkey to either perform the function you want in Outlook (linked to alt-u).
0
 
LVL 5

Accepted Solution

by:
slycoder earned 500 total points
ID: 36490547
I suggest using "Alt+F8" then selecting it from the list.  Seems to be the fastest, most reliable.

Thanks
0
 

Author Closing Comment

by:RemcoVi
ID: 36592536
In practise this seems the best alternative. Thank you for your response.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Find out what you should include to make the best professional email signature for your organization.
When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question