How to make Outlook into a Faux-Gmail
Have you ever said to yourself, “Wow, I really love the way Gmail lets me put labels on my mail so that I can find stuff in several contexts, but I can’t use Gmail for my work email - all the boss man will let me use is yechy old Outlook”. You did? Really? Wow, me too!
Well all hope is not lost. You can have your Outlook and labels too. They’re just called “categories” instead. And with a little bit of configuration, script installation and modification, you can have very similar functionality as you get in Gmail, but on your local PC and without any scary contextual ads.
Warning: this may look like a lot of work and it is initially, but it was something that I really wanted mainly because I had trouble finding things in I had filed in all the subfolders that I used to organize mail previously. Search wouldn’t work because I had to search each subfolder individually leaving me to try to remember all the potential subfolders I could have filed a message in. I wasn’t able to find any 3rd party add-ins for Outlook that didn’t restrict me to only a single way to organize any message so I decided to hack it out myself. The set up was worth it to me, but may not be to you. If you’re ready to take the plunge, then at least you have a guide!
Oh, and this is all for Outlook 2003. If you have an older version, I can’t say whether it will work or not. And, of course, mess with this stuff at your own risk. Don’t start deleting your old folders until you have the new setup working and tested!
The Gist
There are basically 3 things you’ll need to do: create categories and search folders for each of the categories (or combination of categories) you want to label your mail with; and set up a script that will automatically label the mail with the categories you prefer (custom rules) and set up a rule for all incoming mail.
The first two sections you’ll do many times as you define new categories and want to search for them. I went through the emails in my Inbox folder to get started. You won’t have to sort them all manually once you have a script set up but you’ll need to do it now as an opportunity to figure out an initial set of categories, and you’ll need to do it for things that fall through your script filter. You’ll always be able to add more later.
Create and assign your Categories
- Right click on an email you’d like to add a category to and choose Categories…
- You can browse the list of pre-defined categories and check the ones that apply to the email. If you don’t see what you need, type categories separated by commas in the box above the list and click Add to list. Click OK when you’ve added all the categories you need.
[Side notes on Categories: Spaces are allowed in categories. If you prefer not to scroll and click categories you know exist, you can just type them in the box instead and they will be checked for you in the list. This is handy for those of us used to typing in tag lists from tools like Del.icio.us and Flickr.]
Create your Inbox Search Folder
- Right click on Search Folders and choose New Search Folder
- Scroll to the bottom of the list of folder types and choose Custom->Create a custom Search Folder
- Click the Choose… button
- Enter a name for the search folder (I choose *Inbox to make it sort to the top of the list)
- Click Criteria…
- Click on the More Choices tab
- Click the Categories… button
- Type Inbox in the text box or check it in the list and click OK
- Click on the Advanced tab
- Click the Fields button and choose All Mail Fields->In Folder
- Choose doesn’t contain in the Condition combo box next to the Field
- Type Deleted Items in the Value text box
- Click Add to List and then click OK, OK and OK to exit the dialogs
Now you should see the folder for your new inbox under Search Folders. This will be where all unsorted mail ends up. The steps on the Advanced tab are to prevent deleted mail from showing up in your list (since deleted mail still has categories). The messages you see in the Inbox Search Folder are what you will have to categorize manually because they were not caught by the rules you’ll set up in your script.
Create other Search Folders for the categories you want to track in the same way as you created the Inbox Search Folder. I usually only assign a single category (which gives you the functionality similar to Labels in GMail), but you can “bundle” them if you would like.
To create a bundle that will contain messages with any of the categories you specify, choose them from the categories dialog on the More Choices tab. To create a bundle that contains only a specific combination of categories (the email must have all of them assigned) type the names in the More Choices tab’s box and separate them with AND. Once you create a Search Folder for one of the categories that you’ve already assigned to mail, the messages will show up when you click on the folder.
Setting up the Script
If Outlook allowed you to have more than 30-40 rules then we wouldn’t need a script, but personally, I have a lot more than 40 conditions for emails that I want to assign categories to, so the only option is to create a macro that will let me run my own “rules”. Unfortunately that also means we have to deal with some security issues with running macros, but hey, I’ve already gone through all the pain of figuring this out the hard way, so all you have to do is follow the instructions and you’re set!
This won’t be as hard as it may sound!
- Download the Visual Basic script file.
- Go to Tools->Macro->Visual Basic Editor
- You will see Project1 (VbaProject.OTM) on the left with a folder under it called Microsoft Office Outlook and a file under that called ThisOutlookSession. If you don’t see it check out the beginning of David Horowitz’s tutorial on creating an Outlook macro to figure out what to do. Double click ThisOutlookSession to open it in the code editor if it’s not already open
- Paste in the code from the script file you downloaded
- Scroll to the
Sub LoadRules()method and edit and create your rules (see next section) - Save the project by clicking File->Save VbaProject.OTM
Creating your Custom Rules
We want all incoming mail to be queried and potentially labeled automatically so here’s how to set up your rules in the script.
Open the Visual Basic Editor if it’s not already and scroll to Sub LoadRules() method.
You’ll see some commented lines like this:
This is a basic rule that you’ll copy and modify.
The parts are separated by || and here are the options:
- to, from or subject (which email field to search)
- full or partial (match the full search string or just look for the search string in the field)
- comma delimited list of categories
- the string to match (what we’re looking for in to, from, or subject)
So, for example if I wanted a rule to put the Merchants category on all my sales notifications from ThinkGeek.com, I’d set up a rule like this:
Or to add the TimeSensitive and SWA to the 2 day sales emails that Southwest sends:
Or to label all the mail from the Adobe Photoshop yahoo group:
Create as many rules as you like!
Fixing the Macro Security
Unfortunately, because of the way security works in Outlook and VBA (Visual Basic for Applications) you will need to “digitally sign” the macro we just created so that you don’t get asked every time you start Outlook if it’s ok to run your macro. Follow these steps excerpted from an MSDN howto to create the “certificate” you’ll need (name it whatever you would like):
To create a test certificate for use with your VBA projects in Microsoft Office 2000, follow these steps:
On the Windows Start menu, point to Programs, and then click Windows Explorer. In Windows Explorer, navigate to the Program Files\Microsoft Office\Office folder, where Program Files is the drive and folder where you installed Microsoft Office 2000. Find the SelfCert.exe program, and double-click it. NOTE: The SelfCert.exe program is not part of the standard installation of Microsoft Office. If you need to install the SelfCert.exe program, rerun Setup for Office CD1 and click Add or Remove Features. Click the plus sign (+) next to Office Tools; click Digital Signature for VBA Projects and then click Run from My Computer. Click Update Now.
After SelfCert starts, type your name in the Your name box, and click OK. This will generate a digital certificate for the name you supplied.
To use your certificate, come back to the Visual Basic Editor and choose Tools->Digital Signature… The one you just made will show up in the list. Choose it and click OK.
Close the Visual Basic Editor and return to Outlook.
One last step for security. Click Tools->Macro->Security and choose Medium and then click OK.
Create a “Remove From Inbox” button
I added a macro in the script that you can create a button for to remove the Inbox category on mail you have selected which can come in handy. If you’re adventurous you can go create some more helper macros and make buttons for them as well. The macro is called Project1.ThisOutlookSession.RemoveFromInbox and you can find out how to add it to your toolbar (and rename it) from this MSDN tutorial.
Create the Incoming Mail Rule
Last step! We’re almost done.
Again because of the way that Outlook deals with macro security, we have to create a rule that will “turn on” the macro we created. When Outlook starts up, it doesn’t always turn them on for us, so we’ll add a rule that calls a macro we set up that will wake it up.
- Choose Tools->Rules and Alerts…
- Click New Rule…
- Select Start from a blank rule
- Make sure Check messages when they arrive is highlighted and click Next >
- Click Next >
- You will be prompted to confirm whether you want the rule to apply to all incoming mail. Click Yes
- The next screen will ask you to select actions. In the Step 1 box, click run a script.
- In the Step 2 box, click the script link and a dialog will open with a list of available macros. Pick the one named Project1.ThisOutlookSession.StartMacros and click OK
- Click Next >
- Click Next >
- Specify a name for your rule (I called mine Start Macros) and confirm that the Turn on this rule check box is checked. Click Finish
- Click OK to exit the Rules and Alerts dialog
Now, close Outlook and reopen it so that the macros will start properly. The next time you get mail, it should show up in the Search Folders for the categories you set up your rules in script for, or otherwise it will show up in the *Inbox Search Folder waiting to be categorized.
Now you have a simulation of GMail labeling in Outlook. And the added benefit of fixing the problem with broken search because since you no longer need subfolders on your regular Inbox folder when you perform a search it’s on ALL of your mail.
All this takes a little time and effort to set up, but once I did it, I find it is much easier to keep my email organized and accessible. I hope you’ll find it useful too.











January 20th, 2006 at 9:33 pm
To have to go through that much pain to put good features into Outlook shows just how far behind the times Microsoft really is.
March 3rd, 2006 at 3:18 pm
Great how to. Thanks for sharing the results of all your efforts with the rest of us. Much appreciated.
March 3rd, 2006 at 3:24 pm
Also, if you want to give Gmail like search powers to Outlook, you might want to check out http://www.lookoutsoft.com/Lookout/download.html which does a great job. Combining this with your howto will really make Outlook more Gmail like.
October 9th, 2006 at 1:16 pm
Great article! For a similar implementation for Outlook 2000 without the need for searchfolders but with Label menus in the main Outlook interface and in message-, task-, appointment- and contact windows have a look here: http://web-times.blogspot.com/2006/09/part-iii-web-2.html
November 20th, 2006 at 3:21 pm
Hi guys…
anyone else on gmail having problems ?
gmail is fine on adsl, but on my 3g card i can surf net no problem, talk on google talk no problem, but i cannot reply to any gmail mail. also cannot compose and send attachments. can recieve mail fine.
thought it was my beta firefox im using so tried IE but still same problem.
sometimes can reply to a mail but not always, especially if there is an attachment in it…
but gmail is fine on adsl so i know its not gmail themselves. 2 friends have also complained about their gmail on 3g today..
December 25th, 2006 at 1:56 pm
I am a proud Gmail user. Never worrying about email size, incredibly fast reply (powered by AJAX, a technology often used by Google), Web Clips,
automatic forwarding, one button - click search, advanced filters, labels and not folders, message preview, automatic refresh, auto-save messages,as-good-as-yahoomail spam filters, not one executable to be sent or received, feeling of having a different technology? A definite recommendation for
anyone that reads more than one email per day.
Have you tried Gmail? If yes, what's your taste on it? Why do you love it/hate it?
January 18th, 2007 at 8:38 am
I’ve used GMail for a couple of years now, back when beta invites were auctioned off and bartered for (I got my first invite by “trading” someone a print of one of my photos).
I love GMail. It’s been almost a year since I converted my personal domain accounts to GMail for Domains as well, and I’ve set up GMail for Domains for two of my friends/clients too. I think GMail is the best email application that I’ve ever used.
The point is that I can’t use GMail for the corporate email that my company provides me and that I must “live” in on a daily basis. Writing this macro gives me my favorite feature of GMail (labels) in the email client that I am forced to use (Outlook). It’s not a replacement for GMail, but it helps.
Oh, as far as spam filters, I think GMail’s is far superior to Yahoo’s. I have an old Yahoo account I check every now and then which is absolutely filled with spam. Only 2-3 spam messages (out of a couple hundred) a day make it to my inbox in GMail.