Sunday, October 23, 2011

How to Make Outlook Function Like GMail

If you're a gmail user forced to use outlook for certain tasks such as work then you understand how frustrating it can be to lose the gmail functionalities and interface. Several posts describe how to capture some of gmail's most useful behaviors in outlook, namely threaded conversations including sent mail:
  • Outlook 2007 has better ways of merging sent mail with your inbox. The
  • Ultimate Inbox uses a rule to redirect all sent mail to your inbox with the caveat that it will appear there unread and include items you normally don't want in your inbox like new messages you send out not in reply to something else. As pointed out in the comments these issues can be circumvented by 1) creating a new folder that will be used as your new Inbox, 2) creating a new rule that moves all new mail to that new folder, and 3) enabling the option for "In folders other than the Inbox, save replies with original message." This approach works but you lose the sent mail categorization.
  • An alternative solution involves creating an "All mail" search folder that includes the inbox and sent items as suggested by Aelij. This presents an organizational problem since this folder by definition includes everything. Dan Brett improved on this idea by creating a filter to exlude email older than a specified cut-off date, but the functionality of inbox as an organizational tool is somewhat lost.
None of these approaches take full advantage of labels and search folders in outlook. By treating both the inbox and sent items as categories rather than folders, it's possible to capture more of Gmail's functionality including the ability to archive conversations.


Getting Started
First select all of the items in your inbox and click on the 'Categories' button.

Create a new category called "Inbox" and make sure the box next to it is checked. Now when you press OK this category will be applied to every message that you have selected.



Repeat this process for messages in your 'Sent Items' folder by categorizing them as "Sent Mail".

Next we'll create a single folder in which to compile all messages. This folder can either be located in your mailbox or a local 'Personal Folder'. If you have unlimited space or need to access your email from a mobile device then you may want to utilize your mailbox for this folder. The use of local folders complicates the handling of ougoing messages, but once set up you never have to worry about shifting messages around again. This may be especially useful if your company automatically clears your mailbox of messages older than 60 days or something like that. In Outlook 2007 it is important to have all of your messages in one place because search folders in this version cannot span multiple mailboxes.


Create a new folder called "All Mail" making sure the "Personal Folders" location is highlighted.





Now move all of the categorized messages from your 'Inbox' and 'Sent Items' folder to the folder you just created. This is also a good time to convert any other folders you may have to categories and consolidate all of your messages in one place. You can always fish out what you want later using search folders.


The first search folder you need to create will replace the function of your old inbox. Press Ctrl+Shift+P to create a new search folder and highlight 'Create a custom Search Folder' in the dialog box.


Name the search folder "Inbox" and click on the 'Criteria' button.





From the window that pops up select the 'More Choices' tab in the next dialog box then click on the 'Categories' button to select the "Inbox" category.


Press OK and this should take you back to the 'Custom Search Folder' window. Click on the 'Browse' button and uncheck the "Personal Folders" box and check the one next to "All Mail"




The screenshot below shows what the 'Custom Search Folder' window should look like once properly configured.


Repeat the above steps to create a search folder for messages with the "Sent Mail" category along with any others you want.


Now we need to create a rule so that all new outgoing messages are caterorized as "Sent Mail". To do this click on 'Rules and Alerts' from the 'Tools' menu and then click on the 'New Rule' button.




In the window that pops up highlight 'Check messages after sending' and hit 'Next'.



Leave all of the boxes unchecked on the next window and hit 'Next' again.




When prompted if you want to apply this rule to all outgoing messages, choose 'Yes'.




In the next window check the appropriate box to assign outgoing messages to the "Sent Mail" category.






At this point the rule is complete so click on 'Finish'.


Now create a second rule to 'Check messages when they arrive' and assign them to the "Inbox" category as well as move them to the "All Mail" folder. Again this rule should be applied to all incoming messages.




Now Outlook needs to be configured to move all outgoing messages from the 'Sent Items' folder to the "All Mail" folder. There is an easy way to set this up using Outlook's rules, but annoyingly there is no way to automatically mark these messages as read. The following method should work for both IMAP and exchange accounts.


Open up the visual basic editor by pressing Alt+F11. Navigate to and open 'ThisOutlookSession' in the Project pane on the left side of the screen.



Copy and paste in the following code into the editor window making sure that the folder names specified in the 4th to last line exactly match those you use in Outlook.

Public WithEvents SentItems As Outlook.Items
Private Sub Application_Startup()
    Set SentItems = _
Outlook.Session.GetDefaultFolder(olFolderSentMail).Items
End Sub
Private Sub Application_Quit()
    Set SentItems = Nothing
End Sub
Private Sub SentItems_ItemAdd(ByVal Item As Object)
   
Set olApp = CreateObject("Outlook.Application")
Set ns = olApp.GetNamespace("MAPI")
Set AllMail = ns.Folders.Item("Personal Folders").Folders("All Mail")
    Item.Move _
AllMail
End Sub

The above code should work in Outlook 2007 but may not function in Outlook 2010. If you use Outlook 2010 use the following VBA to effectively change your default sent items folder:

Public WithEvents SentItems As Outlook.Items
Private Sub Application_Startup()
    Set SentItems = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderSentMail).Items
End Sub
Private Sub Application_Quit()
    Set SentItems = Nothing
End Sub
Private Sub SentItems_ItemAdd(ByVal Item As Object)
     Dim olApp As New Outlook.Application
     Dim olNameSpace As Outlook.NameSpace
     Dim olCurrExplorer As Outlook.Explorer
     Dim olCurrSelection As Outlook.Selection
    
     Dim olDestFolder As Outlook.MAPIFolder
     Dim olCurrMailItem As MailItem
    
     Set olNameSpace = olApp.GetNamespace("MAPI")
    
     Set olDestFolder = olNameSpace.Folders("Personal Folders").Folders("All Mail")

    Item.Move olDestFolder
End Sub

Save and close the editor. Restart Outlook and choose to enable macros when prompted. This code was originally obtained from Ken Sheppardson's Outlook "Sent Items" Hack which redirects email to the Inbox. I modified this code to instead move outgoing messages to the "All Mail" folder using code that I found here and here which describe how to point to the Personal Folders and its subfolders, respectively.


Now your conversations including your replies can be properly threaded in the "All Mail" folder. However if you reply to or forward a message in your inbox search folder, for instance, then that outgoing message should automatically retain or inherit the categories of the original message/conversation such that it appears in your inbox search folder as well as the "All Mail" folder. Outlook is not configured to do this by default since it is set to strip category information from outgoing messages, but you can change this behavior by adding a single 32-bit DWORD value to the registry. The reg file to add this entry for you can be obtained here.


To enable threaded conversation view in Outlook click on the 'View' menu, then 'Arrange by' and 'Conversation'. I've adjusted and rearranged the default columns as shown below to more closely mimic GMail by removing the subject column (redundant with the conversation heading) and adding a message column to show the first few lines of text from each message.


To assign categories to a conversation just select the header and click on the categories button to select the appropriate categories. Deselecting the "Inbox" category effectively archives the conversation.

Note that Outlook still can't match some of GMail's other useful behaviors such as the ability to unarchive entire conversations when a new message is added. Also, while GMail groups conversations by unique identifiers in the message headers Outlook merely discriminates based on subject. This means unrelated messages will be grouped together if they happen to have a common subject such as "meeting".

I hope you found this post helpful. Please leave me feedback and let me know if you see something that could be improved!


11 comments:

  1. I chose to use my mailbox instead of pointing everything to a "Personal Folder" as I have unlimited space and use my mobile device for email. Can you post the code that is appropriate for this configuration? Thanks!

    ReplyDelete
  2. Try replacing the 4th to last line of code with:

    Set AllMail = ns.Folders.Item("Mailbox").Folders("All Mail")

    This requires that you have a mailbox folder named "All Mail". Let me know if this works.

    ReplyDelete
  3. Thanks for your great instructions. Unfortunately the macro doesn't work for me. I have edited the line as you said to Mailbox instead of Personal Folder. When I restart outlook I don't get a security message asking if I want to enable macros. Is there another way to enable macros? Or am I not saving the macro properly? When I reopen VBA it is there but if in outlook I click on tools>macro>macros none appear, and when you said save and close the editor it didn't get me to call the macro anything.
    Sorry if I am just being stupid.

    ReplyDelete
    Replies
    1. Kate,
      Have you verified that your sent items do not get moved from your Sent Items folder to your All Mail folder? It sounds like you have everything configured properly. Just make sure you use the exact and full name of your mailbox.

      It's possible that your security settings are such that you are not prompted to enable macros. Also, you should not expect to see this macro in the tools>macro>macros list

      Delete
  4. Jeff - Thank you! This is the best tutorial I've found on how to make Outlook 07 function more like Gmail. I'm still having some trouble with my Inbox folder. I've been labeling emails that come in to the appropriate category (just like in Gmail), however when I remove the category label the email stays in my inbox - in Gmail you "move" to a label and the email disappears from your inbox. Thoughts? - K

    ReplyDelete
    Replies
    1. Are you also removing the "inbox" label from the messages? This is not done automatically in Outlook like it is in gmail where you can move a message to a category.

      Delete
  5. This is really a great in depth tutorial, although I am also having issues with the macro. I am running on an exchange server and have tried the macro code with both lines...

    Set AllMail = ns.Folders.Item("\\Mailbox - Baynai, Jeremy").Folders("All Mail")

    And

    Set AllMail = ns.Folders.Item("Mailbox - Baynai, Jeremy").Folders("All Mail")

    With no luck. Like Kate, Outlook never asks if I want to enable macros.

    ReplyDelete
    Replies
    1. Go to Tools>>Trust Center>>Macro Security. Make sure unsigned macros are enabled by selected "Warnings for all macros" Let me know if this works.

      Delete
  6. Great tips. Thanks!
    FWIW, re: "It is imporant to have ALL of your messages in one place because search folders cannot span multiple mailboxes."
    in Outlook 2010, you CAN search multiple mailboxes.

    ReplyDelete
  7. Hi ! Thanks for the tip.
    Unfortunately, the macro doesn't work for me. I'm using a French version of Outlook 2007 and I tried replacing the folder names by the French name but unsuccessfully...

    Any tip ? Thanks a lot !

    ReplyDelete
  8. Gmail was first launched by Google in the year 2004 when several other email services had already made their foothold in the industry. At that time, the service was available in its beta version and was available via limited number of invites only from its existing customers.visit this site

    ReplyDelete