How to Create a Unified Inbox View

Last reviewed on December 30, 2013

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.

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