I’m one of the odd people that actually like Outlook. It’s kind of a love hate relationship though. I like it for precisely the reason that many people hate it. It integrates email, calendar, and tasks all into one program. It can also be a beast, especially when you have to go into its settings to tweak things.
One thing I’ve wanted for a long time is the ability to do things with single keystrokes in Outlook. I wanted to hit the letter ‘a’ and have my currently selected email(s) get moved automatically into an archive folder. I wanted to hit ‘r’ to reply to the current email. Things like that.
I recently came across this blog post that got me very close… What this person did is write a macro for Outlook that could archive messages, and then assigned that macro to a button on the toolbar. Outlook let’s you give the macro a shortcut, but unfortunately, it has to be the ALT Key + some other key…
The way to Nirvana lies in a free and wonderful program called AutoHotkey or AHK for short. AHK lets you write small scripts that can do lots of things, one of which is remap keystrokes. So what I did was write an AHK script that takes single keystrokes and sends different keystrokes that Outlook understands.
Update: The good folks at Lifehacker have put up two posts using my techniques. One for adding an archive macro button, the other for adding shortcut keys. They added some new shortcuts to the list, and I’ve taken a few of them and updated my script as well.
My script has the following shortcuts:
- a — archives the selected message(s)
- j — moves down to the next message
- shift+ j — selects messages as it moves down to the next message
- k — moves up to the previous message
- shift+ k — selects messages as it moves up to the next message
- f — forwards the current message
- r — replies to the current message
- ctrl + r — “replies all” to the current message
- u — marks the selected message(s) as unread
- y — marks the selected message(s) as read
- / — gives focus to the message search box in Outlook
Now this only happens when you’re in Outlook AND when you have an email selected or you’re inside the reading pane reading an email. (After all, my solution wouldn’t be very good if ever time you typed ‘f’ when typing an email your message was opened for forwarding.)
New Mail Shortcut
The other nifty thing my script does is makes the Windows Key + N a shortcut for opening up a new message from anywhere in the computer. Even cooler, if you have a file or files selected when you hit Win + N, then the new message that opens up has those files attached to the email, ready for sending.
Which versions of Outlook does it work in?
The script has been tested in Outlook 2007 on Windows Vista. It will very likely work in Outlook 2007 on Windows XP too. It may work in earlier versions of Outlook, but the code will definitely need some amount of tweaking. (For example, one place refers to a path specific to Outlook 2007.) Unfortunately, I cannot provide the fix for Outlook 2003, though if someone gets it working, I’ll be happy to host the file.
Okay, how do I get it?
Download and install the latest version of AutoHotkey.
Download the Outlook Keys script. By downloading the file, you agree to the legal information included at the end of this page
The zip file has the AHK script and a text file with the macro code for archiving in Outlook.
Save the AHK script someplace in your documents. Double click it to run it. If you want to run the script everytime Windows loads, you’ll have to move a shortcut to the script into the startup folder.
How do I set the macro up for archiving?
The macro code is in the file Outlook Macro Code.txt. You’ll use my code, but follow these instructions to install the macro and set it up so that Outlook doesn’t give you a security warning. (Alternatively, Lifehacker has provided a good writeup on these steps too.)
Pay special attention to how you add a keyboard shortcut to a macro. My AHK script expects that the Outlook macro will have a keyboard shortcut of ALT + . (period). If you give the macro a different shortcut, it won’t work unless you edit my AHK script.
Now perhaps the hardest part is getting the macro to work. Since I don’t know how your folders are setup, you’ll have to change the macro to tell it which folders to use when archiving. Find the following comments in my macro code.
‘set folders to watch
‘set folders to archive to
Currently, if you didn’t modify the code at all, it would work if you had the following folder arrangement in Outlook.
Hitting ‘a’ on a message(s) in the Inbox would move it into the Personal – Received folder. Hitting ‘a’ on a message(s) in the Business folder would move it into the Business – Received folder.
If there were any other folders in the Inbox that weren’t referenced in the code, then they too would go to Personal – Received, since it’s the default archive folder.
So you’ll need to change the folder paths in the macro to match your needs.
I hope others find it useful too. If anyone finds any bugs, please let me know in the comments.
If future releases or bug fixes are needed, the following feed will announce new releases. http://www.ocellated.com/tag/outlook-keys/feed/
While the code here has been tested repeatedly under different scenarios and is believed to work properly, by using it you agree to hold its maker harmless from any damages. This code is released WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This code is released under the Creative Commons 3.0 Attribution Non-Commercial Share Alike license. You can share the code and you can change the code if wish, but the license must remain in effect and you must attribute the original source. You cannot use the work for any commercial purpose.