27 March 2009

How I've implemented GTD with Outlook 2007

I've been trying to follow the Getting Things Done principles since I read David Allen's book with the same name, and I think I have much better control over incoming email and active tasks now. One important GTD principle is to organize incoming correspondence into what you can process right away, what you need more time to work on, what you probably will need in an ongoing project and what you can file for later reference.

After following this principle for a while, my inbox now contains just a handful of items that I have flagged for action, and I also have had the pleasure of achieving zero email bounce a couple of times. Yes, that is a completely empty inbox :) By flagging everything that needs attention, I’m also very confident that nothing will be forgotten or overlooked. The To-Do Bar in Outlook 2007 gives me a very nice overview of all upcoming tasks, and the default calendar view displays the items that are due each day:
image
This view has another great advantage because it also includes what I have completed each day. (This image is not grabbed from my primary work laptop, and I’ve been working on additional stuff during the week :) )

This can be done in Outlook by flagging emails and organize items in folders outside the main inbox manually, but it can be a tedious task in itself. I have therefore written a couple of macros in plain old VBA, that I can invoke from the keyboard. The macros are organized in a custom GTD Toolbar, that looks like this:
GTD toolbar in Outlook 2007 

As you can see from the image, every function is accessible from the keyboard by pressing the Alt key and a number. By using these macros , I can flag items with various actions, move them to my reference or project folders or delete them if I’m sure they aren’t need anymore. I can drill down into the action menu and flag items with actions and categories that indicates I’m waiting for somebody else before I can proceed or items that I intend to read later. If the reference and project folders contain subfolders, I can also drill down into them and file the items exactly where I want. I’ve also implemented an undo feature, but remember that it only tracks what the macros do (with the except of the standard follow up functions on the action menu) and what you do manually in Outlook will interfere with this function.

Installation

This is what you have to do to try out these macros yourself in Outlook 2007:

  • Download the code in this zip file and extract the six files to a local folder:
  • Enable unsigned macros
    • Open “Trust Center” from the “Tools” menu
    • Select “Macro Security”
    • Select “Warnings for all macros”
      This is a potential security concern, and you can sign the macros yourself if you want. Then you can choose to only trust macros signed by your own certificate.
  • Import macros into Outlook
    • Open “Visual Basic Editor” from the “Tools->Macro” menu
    • Click “File –> Import file…” and import each of the six files in the zip-file
  • Enable GTD when Outlook starts (This is optional, because you can also initialize GTD from the toolbar manually when you need it.)
    • Still in “Visual Basic Editor”, double click on “ThisOutlookSession” in the project explorer
    • Paste inn the following code or edit your existing Application_Startup method if you already have one:
      Option Explicit

      Private Sub Application_Startup()
          Set gtd = New CGTD
          gtd.InitializeGTD
      End Sub

    • Close “Visual Basic Editor”
  • Initialize GTD
    • Open the “Macros” window from the “Tools->Macros” menu
    • Select “Initialize” and click “Run”
    • The GTD toolbar is floating by default, but you can drag it everywhere you want

Customization and issues

You can customize the name of the root project and reference folders in the GTDConstants file, but if you have multiple Outlook data files the folder names have to be the same in each file. If GTD can’t find folders with the configured names the corresponding buttons will be disabled. You can also customize the categories that are used to tag items you like to read later or those you are waiting for, and the maximum number of items to keep in the undo stack (only meta information abut the items are stored in the stack). The undo stack is implemented as a ring, so when the stack is full, the new element will overwrite the bottom position and become the new top element.

If something goes wrong, you can usually press the Initialize button to recover from an error. You will loose the undo history, but everything else should work fine. There is one known exception though, and that is if you create a sub folder of your reference or project folders and they didn't previously have any subfolders. The reason for this is that the toolbar button has to be exchanged with an toolbar menu instead, and there is a bug in that code that I haven’t bothered tracking down. This is a rare problem, and it has a simple workaround:

  • Right click on the toolbar and select "Customize..."
  • Select the "Toolbars" tab
  • Select the "GTD" toolbar and click Delete
  • Follow the initialization steps above to recreate the whole toolbar from scratch

Conclusion

I’ve been using these macros for some time now without any problems, and I’m very confident in how I handle the emails I receive. This system also works for notes in OneNote, because you can assign an Outlook task to any text or page in OneNote. You can then track these tasks in the To-Do Bar like any other task or flagged email.

This isn’t a complete GTD solution though, because I still have flagged blog posts in FeedDemon and a list of web pages in the Firefox extension Read It Later. I’m not 100% sure it is smart to have everything in Outlook, but I want to check out News Gator Inbox and see if it can only synchronize the items I have flagged in FeedDemon.

Disclaimer: This code is released as-is without any warranty. If you have questions or comments you are welcome to post a comment on my blog.

9 comments:

  1. Joar,

    I'm trying to install the toolbar and utilize the macros you describe above. Everything goes as planned until I try to run the "Initialize" macro. I get the following error:

    Run-time error '-832306942 (ce640102)': Could not complete the operation because the service provider does not support it.

    I enter debug mode and see that it's hanging up in the GTDMacros module at:

    Public Sub Initialize()
    Set gtd = New CGTD
    gtd.InitializeGTD True
    End Sub

    Any idea what's going on and how I can fix it? Thanks in advance.

    Blake

    ReplyDelete
  2. The only thing I can think of is that I've only tested the macros with Outlook 2007, and if you're running an older version it might not be compatible. I haven’t found any relevant information by Googling the error message either, but “service provider” makes me think that the type of primary e-mail account could be an explanation. My primary account is Exchange and if you have another mail provider (POP3/IMAP), that might be a problem. I have other IMAP and POP3 accounts with their own pst-files in addition to Exchange and the macros works with those, so this is just speculation on my part though.

    I’m sorry I don’t have any better answers for you, but thanks for taking the time to comment on my blog.

    ReplyDelete
  3. Joar, Would you have a outlook macros that could create categories from a specified outlook field.
    For example I use gtd add-in from Netcentrics but would like to create a category from each current project. (for use in IMexchange on the iphone to organise tasks by project)

    ReplyDelete
  4. I'm sorry, but I haven't done any other work on Outlook macros than this little project, and I aren't that familiar with the object model.

    The two categories I'm using is hard coded into a couple of constants, but I guess you can write some code that looks up a field and use my AddCategory subroutine to set the category.

    ReplyDelete
  5. Joar,

    I got the folder macros to work on my exchange folders, but not on my local folders.

    Is this a known limitation?

    /Fredrik

    ReplyDelete
  6. Fredrik,

    I only used the macros on Exchange folders, and I didn't try them on folders inside a local pst file. I found one possible explanation of your problem if the default item type of the folder in the pst is different than normal mailbox folders.

    Since I've upgraded to Outlook 2010 I no longer use these macros and are not able to verify this, but if you're comfortable debugging and modifying the macros your self you can put a breakpoint on line 49 in the CGTD.cls file before you select your local folder. If the DefaultItemType is different from 0 you could try and modify the check to allow other values to see if that works.

    ReplyDelete
  7. Hi Joar,

    does Outlook 2010 provide an alternative to this since you don't use the macros any longer? i don't have the option to swap myself due to corporate standards, but i'm curious.

    I tried to put a BP on line 49 (in exp_FolderSwitch). It never gets executed and exp_FolderSwitch doesn't seem to be referenced in any other part of the macros.

    What is FolderSwitch supposed to do?

    I tried to step from InitializeFolders and it seems to be the GetRootFolder funtion that only goes as far up to the Exchange folder in the hiearchy. i don't know if this is the actual 'top' of the tree or not.

    In the GetRootFolder it stops when the rootFolder.Parent is MAPI. So that it returns the top folder in the exchange mailbox. Then findfolder doesn't find the parallel structure in the local folder.

    At least this is my theory. I don't have any prior experience with Outlook and VB macros.

    ReplyDelete
  8. Hi Fredrik,

    Outlook 2010 has a feature called Quick Steps that allows you to create simple macros very easily. It's not a perfect solution, but it is good enough for my needs.

    The exp_FolderSwitch is an event that should fire when you select another folder in Outlook, and it will detect if you switched to a folder under another root and reinitialize the menus based on the folder structure in your local pst.

    I used this feature to when switching to another email account in Outlook, but unfortunately I didn't test switching to a local pst.

    ReplyDelete
  9. Oh I see, so this makes the macros appear as being local to the account you are working on, as opposed to being global and work across both exchange and local folders.

    I'll see if i can make a workaround for it. I expect i need to hack the FindFolder to start from the topmost object and work down from there.

    Thanks for your help

    /Fredrik

    ReplyDelete