Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-09-03
7
Medium Priority
?
2,842 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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 

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 1500 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

721 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