RemcoVi
asked on
How to assign a hot key to a macro in Microsoft Outlook
I have the following code:
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.
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
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.
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?
ASKER
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.
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".
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".
ASKER
Problem with this is that the shortcut key is ALT + R -> Y -> 1
Thats not an easy shortcut.
Thats not an easy shortcut.
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).
Instead, you could use a tool like Auto Hotkey to either perform the function you want in Outlook (linked to alt-u).
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
In practise this seems the best alternative. Thank you for your response.