Solved

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

Posted on 2011-09-03
7
1,922 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
  • 3
  • 3
7 Comments
 
LVL 37

Expert Comment

by:Gerwin Jansen
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 37

Expert Comment

by:Gerwin Jansen
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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 37

Expert Comment

by:Gerwin Jansen
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Outlook Free & Paid Tools
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now