How to Create a Unified Inbox View

Last reviewed on June 10, 2014   —  68 comments

Applies to Microsoft Outlook 2013, Outlook 2010, Outlook 2007

Everyone wants a unified inbox. Outlook doesn't have anything built in, search folders are per-message store only, and won't work for multiple email accounts. Instant search will search multiple data files, but you need to create the instant search each time you want to use it.

This is a solution to a very popular question of how to create a Unified Inbox in Outlook 2010. It was posted in the TechNet forums by oju2. While not quite the same as a true Unified Inbox for all email accounts, it has one advantage a true unified inbox does not offer: a very easy way to filter out the mail you don't want to see in a unified view by adding additional queries to the txtSearch line in each macro.

This solution could easily be adapted to apply any frequently used search conditions to a folder.

To use, press Alt+F11 to open the VBA editor, expend Project1 and paste the code into ThisOutlookSession. Add Buttons to Your ribbon or QAT to call the macros to quickly enable the Unified Inbox search when needed. Remember: you need to have macro security set on Low, Warn, or sign the macros using SelfCert.

See How to use Outlook’s VBA Editor for complete details.

First let's agree that Unified Inbox is no more than a particular "VIEW" of your Inbox mails on different account. So this is the same as querying your Inboxes. So we can resolve this by doing a simple global query:

Workaround Solution:
1) Type the following in the search box: folder: (Inbox) received: (this week)
2) Press Ctr+Alt+A to or click All Mailboxes button (Outlook 2013) or All Mail Folders (Outlook 2010).
Search  All Mailboxes to create a unified search
3) Hit enter and you should see your Unified inbox for all mails received this week.

A more elaborate solution to automate this is to do a Macro. This is the code you need:

The code for a UNIFIED INBOX:

Sub UnifiedInbox()
Dim myOlApp As New Outlook.Application
txtSearch = "folder:Inbox received: (this week)"
myOlApp.ActiveExplorer.Search txtSearch, olSearchScopeAllFolders
Set myOlApp = Nothing
End Sub

The code for a UNIFIED SENT BOX:

Sub UnifiedSentbox()
Dim myOlApp As New Outlook.Application
txtSearch = "folder: (Sent Mail) sent: (this week)"
myOlApp.ActiveExplorer.Search txtSearch, olSearchScopeAllFolders
Set myOlApp = Nothing
End Sub

Valid Search Scopes

In Outlook 2010 and Outlook 2013, you can choose between the following search scopes:

ScopeDescription
olSearchScopeCurrentFolderLimit the search to the currently selected folder.
olSearchScopeSubfoldersLimit the search to the currently selected folder and its subfolders. To search all folders in one data file, select the top level of the pst.
olSearchScopeAllFoldersSearch all folders (of the current folder type). This search includes all data stores that are enabled for search.
olSearchScopeAllOutlookItemsSearch all Outlook items in all folders in stores that are enabled for search.

In Outlook 2007, you are limited to olSearchScopeAllFolders and olSearchScopeCurrentFolder

Create a macro for any frequently used Instant Search

You can easily use this macro to create a frequently used search and assign it to a button. You can use instant search to get the criteria then copy and paste it in txtSearch line. When a search query includes double quotes, replace them with parenthesis.

For example, category:="MTWT" becomes category:(MTWT)

Sub SearchByCategory()
Dim myOlApp As New Outlook.Application
txtSearch = "category:(Business)"
myOlApp.ActiveExplorer.Search txtSearch, olSearchScopeAllFolders
Set myOlApp = Nothing
End Sub

Use this code to search (in the current folder) for mail received within the last 7 days.

Sub LastSevenDays()
Dim myolApp As New Outlook.Application
Dim tDate As Date
tDate = Now - 7
txtSearch = "received: (" & Format(tDate, "mm/dd/yyyy") & ".." & Format(Now, "mm/dd/yyyy") & ")"
myolApp.ActiveExplorer.Search txtSearch, olSearchScopeCurrentFolder
Set myolApp = Nothing
End Sub

Written by

Diane Poremsky
A Microsoft Outlook Most Valuable Professional (MVP) since 1999, Diane is the author of several books, including Outlook 2013 Absolute Beginners Book. She also created video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.

Please post long or more complicated questions at Outlookforums.

68 responses to “How to Create a Unified Inbox View”

  1. Matt

    PERFECT! Wow....I've searched everywhere for something like this.

    Thanks so much!

  2. Jeff

    A couple years ago I switched from Outlook to Thunderbird. I was quite impressed how robust a free product was. I was going to switch back for a very complex technical reason requiring the GSyncit product combined with Outlook. But I was flabbergasted to see that apparently even in the latest greatest Outlook 2013 there is no option to show a unified view of all matching folders with all accounts? This should be built-in like in Thunderbird. Shame on MS.

  3. Victor Quinones (@VQuinones)

    Excellent! The instructions were very simple and accurate. I had it up and running in 5 minutes.
    Thank you!

  4. Kirk

    I too am disappointed that this feature was removed but appreciate the workaround Diane.
    I had aborted previous attempts on the basis that they would double the local storage space requirement and create version control issues. WHEN Microsoft get around to reviewing this feature, they could do worse than look at the Blackberry unified inbox. Likewise, a unified calendar would be welcome...

    Kirk

  5. Kirk

    Diane, is it possible to integrate a search folder into the folder heirarchy? Ideally, I'd want to create a "unified" folder set into which I could add sub-folders with these search specs - but I'd settle for sub folders of my Exchange account.

    Thanks for the tip about overlays - I'd not even discovered this!! Top tip!

  6. Zane

    THANK YOU!! I can finally move to IMAP without having to change over to Thunderbird.

  7. Derek

    The biggest problem that I see with this approach (and I will agree that it is better than the nothing provided by Microsoft) is that you are limited in the date range options. I can choose "This Month" or "Last Month" for example, but I can't chose "Last 30 days". The difference is that "This Month" shows only items received in January. "Last Month" shows only those items received in December. "Last 30 Days" would show items received either in the past 30 days regardless of whether it was "This Month" or "Last Month". I suppose you could combine search terms to get a more comprehensive range, but this is all very clunky and something Microsoft should have implemented given that it's already a part of their Outlook 2011 program.

  8. Paul Braren

    Diane, this is an amazing article, and I cannot thank you enough. Been waiting for years for this.

    I've grabbed a bunch of screenshots from Windows 8 + Outlook 2013, and tweaked the search to skip the date ranges. This "Inbox All" button now seems to now show all dates, described at:
    http://tinkertry.com/outlook2013inboxall

  9. Paul Braren

    Can the macro be tweaked to ensure searches include not only all configured email account folders, but also any archives that are opened in Outlook? It'd be handy to have a way to have that Unified Inbox include old inactive POP email accounts PST files.

  10. Sam

    Thank you so much, it worked great. Just one question; I have this running on Outlook startup and would be great if it was possible to select Home from the ribbon instead of staying on search view. I've looked everywhere but can't find any methods or keyboard shortcuts to display Home (which includes new, reply and so on). Any ideas if this is possible?

  11. lea526

    HI, thanks for this. Works great, but it only worked for the first week. Both the inbox and the sent buttons stopped working. Any suggestions? I would really like to get this working again.
    Thanks

  12. Gary Moody

    Unified Deleted Items View
    txtSearch
    "folder:Delete Items"

    File | Options | Search area
    Check the box -"Include messages from the Deleted Items folder in each file when searching in All items"

  13. Gary Moody

    Unified Deleted Items View (Code)
    Sub UnifiedDeletebox()
    Dim myOlApp As New Outlook.Application
    txtSearch = "folder:Delete Items"
    myOlApp.ActiveExplorer.Search txtSearch, olSearchScopeAllFolders
    Set myOlApp = Nothing
    End Sub

  14. Bill Hunt

    Unified Inbox works fine, but having trouble setting up a second macro - Sent All. I'm using Outlook 2013 with Windows 7. I got "Inbox All" to work fine. It is saved to VbaProject.OTM and I can save it, close outlook 2013 and re-open it and it works. Then I re-opened VBA editor -added the code for Sent All- made a new certificate for it, saved and closed and tested. The Sent All macro worked the first time, but the Inbox All no longer works. If I close Outlook it asks to save again, and when I do and then reopen Outlook, neither macro works. Am I doing something wrong? It seems there can be only one VbaProject file- no Project 2 or 3?

  15. Bill Hunt

    I was overwriting the first macro with the second. Modules was the answer I needed. I put the second macro in a separate module and both now work fine. Yes each has a separate QAT button. Many thanks!!

  16. Simon Mason

    I just installed this under Outlook 2010 and it seems to work well. Thanks. One question, I have a number of sub-folders under my Inbox in my various IMAP accounts that I sort email into. I would like to exclude all sub-folders from the universal inbox, and only show the top-level Inbox. How would I modify the code to acommodate this? Thanks.

    Update, I tried changing scope to olSearchScopeCurrentFolder but this didn't do exactly what I wanted. This limited the search to just the first inbox in my profile. I have 5 inboxes in the profile. When using the olSearchScopeAllFolders it displays all inboxes (and sub-folders). Is there a way to just show the inbox (and no subfolders) from each mail account? Perhaps I can specify them individually in the macro?

  17. lucky26

    Hello and thank you for the great post and subsequent comments. I have noticed that only 2 inboxes are showing up in the search results and both happen to be .PST folders. However, there are another 3 Exchange accounts that are not showing up in the search results. Is there a limitation to the search method which prohibits Exchange folders from showing? What about IMAP folders? I don't have an IMAP account yet, but will likely have one in the near future. To add to the confusion, my XP 2010 Outlook also shows only 2 accounts, however, one of them is my Exchange account. In this case the PST and OST folders are all in the same folder on the computer and there is only one PST folder there, whereas, in the first case mentioned, the 2 PST folders are in the Documents folder and the 3 OST folders are in the Local>Microsoft>Outlook folder.

    Also, for some reason, the first Inbox name is showing as "Inbo" in the folder title when sorted by Folder...

    Just to make sure you know the parameters I have used I have copied them below for you.

    strDate = Date - 120 & ".." & Date
    txtSearch = "folderpath:Inbox folder:Inbox received: (" & strDate & ")"
    myOlApp.ActiveExplorer.Search txtSearch, olSearchScopeAllFolders

    Also, it was interesting that in Outlook 2010 on an XP computer, the folderpath:Inbox parameter resulted in showing a folder which also had Inbox as part of the folder name. Even after changing the name of the folder which included the word Inbox the search results are still showing that folder. I am hoping that after the indexing has been completed this will also be removed. If you have any other suggestions in this regard I would greatly appreciate them.

    Thank you
    RM

    Thank you
    Lucky26

  18. lucky26

    Thanks for the quick reply.

    The Exchange accounts are all cached. On the Windows 8 Outlook 2010 system, Search Ribbon>Search Tools>Locations to Search all Exchange boxes and PST accounts are checked. I only unchecked the Internet Calendars box. On the Windows XP Outlook 2010 system (which was an upgrade from Outlook 2007 and Office 2003) all accounts are also checked. The only accounts I have unchecked are the archive PST folders and the Internet Calendars boxes. Is there something else I need to check?

    Thanks again!

  19. Ramin

    I don't understand the meaning and significance of a mailbox vs shared or secondary mailboxes as it relates to the issues I encountered.

    Thank you!

  20. Robby

    I love this workaround thanks! However, my particular need doesnt seem to be covered above.

    My workaround has been this:

    I created a new PST file and named it Unified and I use a recent search command which I dropped into my QAT. I also set my search options to always search ALL mailboxes.

    When I open outlook its set to go to Unified profile first, then I click on my recent search from the QAT that looks for anything in an 'inbox' received 'last week' from ALL MAILBOXES.

    My problem: I cannot seem to replicate this in a Macro so I can just click the macro button on my QAT...instead of having to choose the recent search from my QAT drop down menu and have to set my default look in as ALL MAILBOXES.

    Is there a way to search ALL MAILBOXES in your macro examples or does it just extend to ALL OUTLOOK ITEMS within just the current profile/mailbox?

  21. Robby

    Well yes that does work now! No idea why it didn't work before I'm sure I went with All Folders, could have been my security that I played with after. Thanks. Very useful workaround.

  22. Robby

    Just one more question: What do I need to do to run this macro automatically when Outlook opens?

  23. lucky26

    Thanks again! Yes, all mailboxes are cached and included in the search index.

    Now that indexing is complete I see that on the Win 8 computer when I group the emails by "Account" the 2 PST accounts and one Exchange account show individually grouped. However, 2 other Exchange accounts are grouped under one account with the name "(none)".

    Do you know what's causing this and how to fix it?

    Also, I noticed that when I delete some emails in the individual account view (not the All Inbox view), the deleted emails still show in the All Inbox view. Does this mean that the deleted emails are cached for the All Inbox view and I should wait until the emails are re-indexed for the deleted email to be removed from the All Inbox view as well. This can be very confusing... It seems I can delete emails from the All Inbox view only one at a time. When I select a few emails (spam) for deletion in the All Inbox view they either take a long time to be deleted or they are not deleted at all...

    Please let me know if I am asking too many questions and off topic. I appreciate this work around and find odd things as I continue to use it...

    Thanks again!

  24. lucky26

    All mailboxes are for accounts in my profile. There are no shared mailboxes.

    I understand the issue with deleted mail taking time to show up in the All Inbox search. Looks like I should limit my searches to a short time period because when I search for "this year" or the last 4 months the system is very slow in moving through the emails.

  25. dougetrumpet

    Elegant!

  26. Minesh

    Hi Diane,

    I have seen your work pop up all over my searches recently and using your unified inbox method I have almost setup outlook the way I want it. So thank you for posting your knowledge to the interweb.

    The two things that I would like are for the macro to return the ribbon to home after it runs and unfortunately the Interaction.SendKeys "%H%{RETURN}" methods didn't work.

    I would also like the search to only search the inboxes from 3 out of the 8 IMAP accounts I have configured. Would you know how I can modify the macro to do this?

    Thanks

    Minesh

  27. kcampbe

    This was tremendously helpful in weaning myself from Thunderbird! Thank you!

  28. brandon

    so if i got this right, when indexing is done, it should show all emails from all inboxes in all 4 of my accounts in one time stamped view? because right now, it is missing emails in between emails. going to bed after a full reimage and setup that took all night. hopefully, indexing will finish and i can test this out fully when i wake up. thank you so much for your help. this is going to help me help clients when i make sure it works. :)

  29. eric

    :-( . Anyway thanks for the use-full VBA code. I love it

  30. Lasse

    Is it possible to filter so only unread is shown?

  31. Tav

    YOU'VE SAVED MY HEAD FROM EXPLODING! THAAAAAAAAAAAAAAAAAAAAAAAAAAANK YOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOUUUU!!!!

  32. lakeladJordan

    I just switched to IMAP and this macro helped me greatly. I was wondering if this macro can be automatically ran at application startup so it's the first thing you see. Is this possible? thank you

  33. Vicky Rowe

    Odd, I copied and pasted the code, saved it and then ran it and got 'Sub or function not defined' when running it.

  34. Ian

    Great article but seem to have an issue when I try and view two exchange mailboxes in one view. Both mailboxes list in the left panel and are available to view and search individually but this tweak does not seem to show the second mailbox.
    I also have an IMAP account configured on the same profile that shows up.

    Any ideas?
    Thanks in advance..

    Ian

  35. Ian

    Hi
    I have tried adding it under the Email tab on the E-Mail Accounts setting window and also under the profile from the same tab select default - Change - More settings - advanced - mailboxes but neither seem to show.

    Thanks in advance

    Ian

  36. Ian

    Setting the cache options seems to have sprung everything into life, the check box was ticked but indexing seem to need a kick to get everything working - MANY THANKS

  37. Nike

    Thanks for this guide, it helped me a lot.
    I was wondering if there is any way of creating an ALL BY PERSON VIEW in Outlook, just like in Lotus Notes. The view is grouped by person and contains all mails from a certian person. It can be located in sent, inbox or a specific folder. Is that possible in some way?

  38. Ken

    Hi Diane! Longtime reader, first time posting; thanks for all your help over the years!

    This by far is your best post and it works great for my local data files and exchange account but I can't seem to figure a way to pull in a public folder (email inbox) where I have full control access. Am I not trying hard enough?

    THANKS!!!

  39. Jack

    Just wanted to say THANK YOU. This macro has saved me a tremendous amount of time for our business. I have integrated this macro on all our work computers!

Leave a Reply

If the Post Coment button disappears, press your Tab key.