Outlook Folder Macros for Getting Things Done

5 03 2010

.NET Quirks

March 5th | Jonathan Cogley

I have been using GTD (Getting Things Done) for about 5 years now and it works. It is a great system to manage all aspects of your work and personal life. The turning point for me was when I had too many tasks and correspondence to manage in my head or my inbox. GTD allows you to create “contexts” where you will do work – for example @home, @computer, @phone, @errands, @withAccountant, @withCindy or even just filing for future reference #Done. This lets you move items from your inbox to the proper place for the work to be done. This makes your inbox more of a processing center (with the focus being getting to zero). Getting your inbox to empty and knowing that all tasks are in the right places brings on a Zen-like feeling of calm and control :) .

My tool for email is the corporate standard – Microsoft Outlook 2007. I love Outlook – it is an incredibly rich and powerful client which allows me to quickly move between my email and my calendar (don’t even get me started on web mail!). Creating “contexts” is easy – simply create folders representing each context and then move items from your inbox to each folder. And there begins the problem …

Moving items between folders in Outlook is painful – there are only two built-in options:

1) Drag the item using the mouse from your inbox to the folder (try that 50 times in one morning!).

2) Use the keyboard. Ctrl-Shift-V brings up the Move to Folder dialog, then navigate the folders using the cursor keys and hit Enter (also way too slow).

What about an Outlook macro? Outlook has the capability to allow tedious items to be recorded or even coded using VBA (Visual Basic for Applications). Not exactly my language of choice but if it works, use it. You can access macros within Outlook by going to Tools | Macros | Visual Basic Editor. Right click on modules in the Project Explorer and click Insert | Module.

>>See the Macros (.txt file)

The sub procedure “MoveToFolder” is really the meat of the code – it uses the recursive GetFolder to find folders by name anywhere in the inbox structure and then moves the selected items to the folder while also keeping track of items for undo. To get it all working, simply create new sub procedures for each context you want to target – for example: MoveToFolder_WaitingFor targets the “@waitingfor” folder. Save your macros and close the Visual Basic Editor (you can return to it at any time to add more target sub procedures).

Now we need to tie these macros to shortcut keys and menu items. This is very easy in Outlook – right click on the menu toolbar and select “Customize”, go to the “Toolbars” tab.

Click “New” to create a new toolbar. Call it “GTD” (or whatever) and click OK. Now drag the new toolbar onto the main toolbar at the top of Outlook. Then right click the new toolbar, click “Customize”, then go to the Commands tab to find the macros. Drag macros to the toolbar, then right click on the new toolbar item to further customize the text, icon and keyboard shortcut. Note that the keyboard shortcut you select mustn’t interfere with other standard shortcut keys in Outlook else they won’t work (I have used ALT-\, ALT-o, ALT-C, etc).

To add a new macro to move to a different folder, simply copy one of the existing ones, rename it and then add it to your toolbar.

Were these macros helpful? How do you manage your email GTD-style?

Note: I did have some trouble implementing “Undo” for the folder moves (essential for when you accidentally move the wrong thing!). Outlook doesn’t seem to support Undo in the same manner as other VBA-enabled applications. Just map the “UndoMoveToFolder” to get it working.

Jonathan Cogley is the CEO of Thycotic Software, an agile software consulting and product development company based in Washington DC. Secret Server is our flagship enterprise password management product.Are you on Twitter? Follow Jonathan


Actions

Information

5 responses

8 03 2010
Kevin

Outlook 2010 has this built in. Woo!

28 03 2010
Sunil

Thanks for this wonderful script , This is what exactly i was looking for ..

30 04 2010
kiddo

Hi:

I have created new tool bar and dropped the macro on it. But when I right click to customize I see option of modify text, image and others but not ‘keyboard shortcut’. I want keyboard shortcut for this macro and not able to do it. Am I doing something wrong.
Please advise.

Kiddo

30 04 2010
admin

When you edit the text for the button, use the & symbol before the key that you want to be the shortcut key. e.g. C&omputer will make ALT-o the shortcut key for that buton.

Note that many keys are already used by Outlook so they won’t work if you try to map them to your own buttons.

6 05 2010
Dhananjay Goyani

Its been roughly 2 months I started using your GTD approach. And I would like to say that I am really amazed how it has made my life simpler.

Thank you so much!
Dhananjay

Leave a comment