A simple mail filer for Microsoft Outlook (VBA)

Like many people I receive an unmanageable amount of email each day. Many days I get through only around 1/3 of the email I receive.

However, the role I am in professionally requires me to retain a large proportion of correspondence. Some because it relates to ongoing projects, other because of security, audit or compliance reasons.

In addition, I work across many projects. It isn’t unusual for me to be involved in two dozen projects at any one time on top of my day-to-day management work.

So I have many folders – hundreds in fact – and filing email into the right folder has become a real drag. It can take an appreciable amount of time to hunt down the correct folder and Outlook does not provide any way to search/filter folder names in the UI.

Thankfully, I have access to VBA in Outlook. While the experience of using VBA macro’s to control Outlook is rarely pleasant, it does get the job done – mainly.

My requirements for the utility were as follows:

  • Must let me select multiple emails, if any have already been filed, show me the folder(s) so I can quickly file new email to the same folder as the rest of the conversation.
  • Must give me a list of all my folders with a simple way of filtering the list by typing a few letters.
  • Must also let me open a folder for viewing instead of filing or cancelling.

A couple of hours later, I was able to create a new utility. This has been published to Github and you can find it at:

https://github.com/TotallyInformation/outlook-filer

Outlook 2013 URL Protocol Handler

Outlook has a custom URL protocol that allows interaction with different elements such as folders, mail and calendar items and contacts, Since Outlook 2007, this has been restricted for use only within Outlook itself but there are some tremendous opportunities for use from simple web systems. This post explains how to turn it on, even for Outlook 2013 (Office 365 version). It also gives pointers to other articles on how to use the protocol.

One of the nice features about older versions of Microsoft Outlook was that it had a set of URL Protocol Handlers (like outlook:inbox) defined that could be used system wide to trigger actions in Outlook such as opening a folder, creating or editing an item.

Unfortunately, along the way, these got gradually toned down so that they only worked from within Outlook itself.

This can still be useful. I’m not sure how many people realise that you can create “folders” in your Outlook mailbox. Choose Properties .../Home Page and set a URL – maybe your blog or Intranet. Now when you click on the folder, you will see the web page instead of a set of mail items or whatever.

When using this feature to do some more clever stuff such as creating To Do lists from incoming mail, you might choose to use a dynamic web system to handle the list. CouchDB or Node.JS are lightweight web systems that come to mind.

Then you might find yourself wishing that you could create links in your To Do system back to the original email in Outlook. Well you can! Sort of.

It turns out that, although the external use of the Outlook: protocol hasn’t been available since Outlook 2003, it can still be turned on, even in Outlook 2013. There is a useful article on the TeamScope web site that shows you how to turn on the outlook: protocol system-wide.

One minor wrinkle though if you use Office from an Office 365 subscription – the location for Microsoft Office applications is different! You will find them at: C:\Program Files\Microsoft Office 15\root\office15.

Here then is the registry code that you need to enable the protocol:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\outlook]
"URL Protocol"=""
@="URL:Outlook Folders"

[HKEY_CLASSES_ROOT\outlook\DefaultIcon]
@="\"C:\\Program Files\\Microsoft Office 15\\root\\office15\\OUTLOOK.EXE\""

[HKEY_CLASSES_ROOT\outlook\shell]
@="open"

[HKEY_CLASSES_ROOT\outlook\shell\open]
@=""

[HKEY_CLASSES_ROOT\outlook\shell\open\command]
@="\"C:\\Program Files\\Microsoft Office 15\\root\\office15\\OUTLOOK.EXE\" /select \"%1\""

Simply save this into a .reg file and open it to install the changes.

Now you can use the outlook: protocol anywhere on the system, great for dynamic web systems.

One minor word of warning though – there are dangers! Don’t open links unless you know what they are, where they go and what they do!

To find out how to use the Outlook protocol handler, try one of the following articles:

One final note. I’m now looking to create some tools that link between Outlook and CouchDB. CouchDB provides a very lightweight NOSQL database that uses JSON and JavaScript to great effect. I’m already using it to track statistics on incoming/outgoing emails, linking the web interface back to Outlook via the home page method mentioned at the start. I’m going to have a go at creating a task monitor too if I get the time. I am currently reading only around a quarter of the emails in my work inbox and I really need some tools to improve the situation. Food for some more blog posts hopefully.

Critical Bug in Outlook 2007

I’ve recently stumbled on a bug in Outlook 2007. Apparently it is quite well known and the only reason that I hadn’t found it was that I don’t use Outlook as my main email client. In fact I only use email on it to handle meeting requests.

The bug is that Outlook 2007 ignores the setting regarding sending reply requests for IMAP accounts.

If this seems rather irrellivant to you, you might want to think again.

If you have an email account that receives SPAM and you access it via IMAP, Outlook 2007 will ignore your setting for reply requests (the setting is defaulted to prompt). Since many SPAM emails have reply requested turned on, you will suddenly find that Outlook is trying to send a whole load of email messages that do not appear in any folder! You haven’t been asked, it is just doing it.

This is bad enough as you are now leaking information about your account out onto the Internet – but it gets worse!

Outlook does not send the replies out using the account that recieved the SPAM, it sends them out from the DEFAULT account.

So if you have, lets say for example, a work account that doesn’t recieve significant SPAM and is your default account in Outlook. Then you have a second, personal account perhaps, that does recieve significant SPAM. You will suddenly find that Outlook is sending hidden emails from your work account – these are the reply responses from your personal account. Now you are leaking information about your work account.

Now, there is a new, big update to Outlook 2007 that has just been released. It is not yet on Windows Update but Microsoft are touting it as the biggest and best set of updates for Outlook ever – see Jimmy May’s blog post for more information. Sadly though, despite the hype, the new update does not fix this critical bug.

The update – which will be part of the Service Pack 2 (SP2) for Office 2007 – certainly does vastly speed up the operation of Outlook 2007 so there is some good news.


Technorati : , , , , ,
Diigo Tag Search : , , , , ,