Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3045
  • Last Modified:

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

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
RemcoVi
Asked:
RemcoVi
  • 3
  • 3
1 Solution
 
Gerwin Jansen, EE MVETopic Advisor Commented:
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
 
RemcoViAuthor Commented:
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
 
Gerwin Jansen, EE MVETopic Advisor Commented:
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
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
RemcoViAuthor Commented:
Problem with this is that the shortcut key is ALT + R -> Y -> 1

Thats not an easy shortcut.
0
 
Gerwin Jansen, EE MVETopic Advisor Commented:
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
 
slycoderCommented:
I suggest using "Alt+F8" then selecting it from the list.  Seems to be the fastest, most reliable.

Thanks
0
 
RemcoViAuthor Commented:
In practise this seems the best alternative. Thank you for your response.
0

Featured Post

Independent Software Vendors: 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!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now