• Outlook User
  • New Outlook app
  • Outlook.com
  • Outlook Mac
  • Outlook & iCloud
  • Developer
  • Microsoft 365 Admin
    • Common Problems
    • Microsoft 365
    • Outlook BCM
    • Utilities & Addins

How to Create a Unified Inbox View

Slipstick Systems

› How to › How to Create a Unified Inbox View

Last reviewed on April 9, 2020     172 Comments

Applies to: Outlook (classic), Outlook 2007, Outlook 2010

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.

Vote for a Unified Inbox feature in Outlook 2016: Unified Inbox for Outlook 2016

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 newer 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.
olSearchScopeCurrentStoreLimit the search to the current mailbox.
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 = Date - 7 '7 days ago
txtSearch = "folder:Inbox received: (>" & tDate & ")"
myolApp.ActiveExplorer.Search txtSearch, olSearchScopeCurrentFolder
Set myolApp = Nothing
End Sub

To find messages between two dates, use this string:
txtSearch = "received: (" & Date - 14 & ".." & Date - 7 & ")"

You can use an Inputbox to enter the values to count back:
calculate the days
folder:Inbox received:3/30/2020..4/4/2020

Sub UnifiedInbox()
Dim myOlApp As New Outlook.Application

daysno = InputBox("Enter the days, separate with comma, the larger number first")
iDay = Split(daysno, ",")
date1 = Date - iDay(0)
date2 = Date - iDay(1)
txtsearch = "folder:Inbox received:" & date1 & ".." & date2

myOlApp.ActiveExplorer.Search txtsearch, olSearchScopeAllFolders
Set myOlApp = Nothing
End Sub

Or enter the dates, in short date format of m/d/yy or m/d/yyyy
enter the two dates, comma-separated
folder:Inbox received:4/1/20..4/4/20

Sub UnifiedInbox()
Dim myOlApp As New Outlook.Application

daysno = InputBox("Enter the dates, separated with a comma, the oldest date first")
iDay = Split(daysno, ",")
date1 = iDay(0)
date2 = iDay(1)
txtsearch = "folder:Inbox received:" & date1 & ".." & date2

myOlApp.ActiveExplorer.Search txtsearch, olSearchScopeAllFolders
Set myOlApp = Nothing
End Sub

Merged with the code to paste the clipboard contents into a message from "Paste clipboard contents using VBA", this string sample would search for the text that is on the clipboard. Combine it with predefined search terms like this:
txtSearch = "received: (" & tDate & ".." & Date & ") " & strPaste

Don't forget to set a Reference to the Forms library. If you receive a "User-defined type not defined" you are missing the reference to Microsoft Forms 2.0 Object Library. If its not listed, add C:\Windows\System32\FM20.dll or C:\Windows\FM20.dll as a reference. "Paste clipboard contents using VBA" has screenshots and more details instructions.

Sub SearchClipboard()
Dim myOlApp As New Outlook.Application
Dim strPaste

Dim DataObj As MSForms.DataObject
 Set DataObj = New MSForms.DataObject
 DataObj.GetFromClipboard
 
strPaste = DataObj.GetText(1)

txtSearch = strPaste
myOlApp.ActiveExplorer.search txtSearch, olSearchScopeAllFolders
Set myOlApp = Nothing
End Sub

How to use the macros on this page

First: You need to have macro security set to the lowest setting, Enable all macros during testing. The macros will not work with the top two options that disable all macros or unsigned macros. You could choose the option Notification for all macros, then accept it each time you restart Outlook, however, because it's somewhat hard to sneak macros into Outlook (unlike in Word and Excel), allowing all macros is safe, especially during the testing phase. You can sign the macro when it is finished and change the macro security to notify.

To check your macro security in Outlook 2010 and newer, go to File, Options, Trust Center and open Trust Center Settings, and change the Macro Settings. In Outlook 2007 and older, look at Tools, Macro Security.

After you test the macro and see that it works, you can either leave macro security set to low or sign the macro.

Macros that run when Outlook starts or automatically need to be in ThisOutlookSession, all other macros should be put in a module, but most will also work if placed in ThisOutlookSession. (It's generally recommended to keep only the automatic macros in ThisOutlookSession and use modules for all other macros.) The instructions are below.

The macros on this page should be placed in a module.

Open the VBA Editor by pressing Alt+F11 on your keyboard.

To put the code in a module:

  1. Right click on Project1 and choose Insert > Module
  2. Copy and paste the macro into the new module.
  3. Add a button to the ribbon or toolbar for the macro then click to run it.

More information as well as screenshots are at How to use the VBA Editor

More Information

Instant Search Queries
Use Instant search to find messages from a contact

How to Create a Unified Inbox View was last modified: April 9th, 2020 by Diane Poremsky

Related Posts:

  • Use Instant search to find messages from a contact
  • Find messages in a conversation
  • Remove old appointments from your calendar
  • Outlook Instant Search Queries

About 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.

Subscribe
Notify of
172 Comments
newest
oldest most voted
Inline Feedbacks
View all comments

Peeter Parelo
September 4, 2023 5:32 pm

Those who find macros and VBA a bit scary can try out our Outlook Add-in "Unified Inbox for Outlook". It uses the same search folder approach, but it's just neatly packaged for easy installation and use.
Check out https://inbox.fgh.ee/
It's not perfect but at least it's something :-)

0
0
Reply
JPMarro
June 26, 2020 3:09 am

I set this up a while back but today realized it's not working quite as expected. One of the Inboxes is for a Gmail account. When I go to that Inbox in Outlook, or direct to Gmail, there I can find a particular email with the Subject line [email I want to see]. it is labeled Important. However, when I use the macro as described above that email does not appear in the results. i.e. when I Search for the Subject or words in the body the email is not found. I assume this has something to do with the Important label, but what's the cure so that all Inbox emails are identified by the above macro?

0
0
Reply
Hermenegildo
May 29, 2020 3:25 am

Dear Outlook users. Could anyone confirm that the Sub UnifiedInbox() also works in Outlook 365? I had setup several unified folders in office 2016, but now, the subroutine makes outlook crash/restart, at least on my end.
Thanks.

0
0
Reply
Diane Poremsky
Author
Reply to  Hermenegildo
May 29, 2020 8:15 am

it's working here, in the insider fast build. I'll check it on a current build.

0
0
Reply
Steve
March 19, 2019 4:27 pm

Diane,

I have been using your great fix for years for a unified INBOX. However we just upgraded to Office 365 for Exchange form Outlook 2010 from Exchange. It is not working with 365? Any help appreciated.

Steve

0
0
Reply
Diane Poremsky
Author
Reply to  Steve
March 19, 2019 6:55 pm

It should work... Do you have macro security adjusted? Does it not run or not find anything? Do you receive any error messages?

0
0
Reply
Steve
Reply to  Diane Poremsky
March 20, 2019 11:40 am

No error messages. It seems to load. But is not pulling emails from all my inboxes. We do have 2 exchange accounts. It worked perfectly with Outlook 2010.

0
0
Reply
Diane Poremsky
Author
Reply to  Steve
March 28, 2019 12:12 am

Are both accounts in as accounts? It won't work for shared mailboxes.
Are both accounts set up as cached mode?

0
0
Reply
C. Yusuf Mumtaz
July 26, 2018 5:11 am

If I create a unified inbox with a MAPI account (default) and three IMAP accounts, will this result in the IMAP emails getting categories and custom flags? That would make it worthwhile and preferable to the redirect system where I have to set up POP3 send only accounts in Outlook. Is that option available?

0
0
Reply
Samuel
July 17, 2018 5:20 pm

I would like to run the sub on startup, but I get an error (429 ActiveX element could not be created). How do I wait for the ActiveExplorer to exist?

0
0
Reply
Diane Poremsky
Author
Reply to  Samuel
July 18, 2018 7:32 am

Possibly, since there is nothing in the code that would use any control. What code are you using to trigger it at startup?

0
0
Reply
Samuel
Reply to  Diane Poremsky
July 26, 2018 8:08 am

Thank you for your answer.
I have added the following lines to 'ThisOutlookSession':

Private Sub Application_Startup()
    'Do While Application.ActiveExplorer Is Nothing
    '    Sleep (1000)
    '    MsgBox ("Waiting")
    'Loop
    Call mUnifiedFolder.UnifiedInbox
End Sub

This prevents outlook from opening and finally yields the error mentioned above.

0
0
Reply
Kemi
May 20, 2018 2:53 am

Hi,

Thanks for this. Zero experience with VBA but I managed to set up the unified inbox on my first try!

However, I can't get the unified sent box macro to work. It says 'we couldn't find what we were looking for'. Do you have any tips?

0
0
Reply
Diane Poremsky
Author
Reply to  Kemi
May 22, 2018 12:05 am

Are you using the general 'this week' macro or one that includes other criteria ?

0
0
Reply
Rogerio
October 23, 2017 10:06 am

Hi Diane. Thanks for sharing this solution. To be honest I did not test it and unlikely will do due to its complexity even being familiarized with VBA.
I have a similar problem in my office because colleagues have some difficulties in using IMAP as they want to work with at least five email accounts - they use POP3 instead.

Well, if you allow me, I have tested my own solution that consists:

1- Create a new PST to Outlook;
2- Create a rule that copies every single incoming message to the new PST;
3- Place the new PST box to favourites;

That's all!

I can't understand why Microsoft didn't create the same solution that works perfectly on Outlook for iOS.

All the best and thank you for keeping this site working. I love it !

0
0
Reply
Diane Poremsky
Author
Reply to  Rogerio
October 23, 2017 10:45 am

>> they use POP3 instead.
if they are using POP, then no ned for this:
>> Create a rule that copies every single incoming message to the new PST
Just set the accounts to deliver to the same pst - this avoids all of the problems associated with rules and creating duplicated messages. Replies will be sent from the proper account - they will need to select the correct account for new messages.

iOS (and mac, android) apps don't have the same limitations that Outlook does (since thye were built new from the ground up), mostly due to legacy code and how search works. They are working on improving search, so we might see some changes in the future.

FWIW, i have 5 accounts in my profile (and 3 shared mailboxes) and just added each inbox to the Favorites instead of using instant search to create a unified view. I ordered them in order of importance and go down the list to work the inboxes.

0
0
Reply

Visit Slipstick Forums.
What's New at Slipstick.com

Latest EMO: Vol. 30 Issue 31

Subscribe to Exchange Messaging Outlook






Support Services

Do you need help setting up Outlook, moving your email to a new computer, migrating or configuring Office 365, or just need some one-on-one assistance?

Our Sponsors

CompanionLink
ReliefJet
  • Popular
  • Latest
  • Week Month All
  • Jetpack plugin with Stats module needs to be enabled.
  • Move Deleted Items to Another Folder Automatically
  • Open Outlook Templates using PowerShell
  • Count and List Folders in Classic Outlook
  • Google Workspace and Outlook with POP Mail
  • Import EML Files into New Outlook
  • Opening PST files in New Outlook
  • New Outlook: Show To, CC, BCC in Replies
  • Insert Word Document into Email using VBA
  • Delete Empty Folders using PowerShell
  • Warn Before Deleting a Contact
Ajax spinner

Recent Bugs List

Microsoft keeps a running list of issues affecting recently released updates at Fixes or workarounds for recent issues in classic Outlook (Windows).

For new Outlook for Windows: Fixes or workarounds for recent issues in new Outlook for Windows .

Outlook for Mac Recent issues: Fixes or workarounds for recent issues in Outlook for Mac

Outlook.com Recent issues: Fixes or workarounds for recent issues on Outlook.com

Office Update History

Update history for supported Office versions is at Update history for Office

Outlook Suggestions and Feedback

Outlook Feedback covers Outlook as an email client, including Outlook Android, iOS, Mac, and Windows clients, as well as the browser extension (PWA) and Outlook on the web.

Outlook (new) Feedback. Use this for feedback and suggestions for Outlook (new).

Use Outlook.com Feedback for suggestions or feedback about Outlook.com accounts.

Other Microsoft 365 applications and services




New Outlook Articles

Move Deleted Items to Another Folder Automatically

Open Outlook Templates using PowerShell

Count and List Folders in Classic Outlook

Google Workspace and Outlook with POP Mail

Import EML Files into New Outlook

Opening PST files in New Outlook

New Outlook: Show To, CC, BCC in Replies

Insert Word Document into Email using VBA

Delete Empty Folders using PowerShell

Warn Before Deleting a Contact

Newest Code Samples

Open Outlook Templates using PowerShell

Count and List Folders in Classic Outlook

Insert Word Document into Email using VBA

Warn Before Deleting a Contact

Use PowerShell to Delete Attachments

Remove RE:, FWD:, and Other Prefixes from Subject Line

Change the Mailing Address Using PowerShell

Categorize @Mentioned Messages

Send an Email When You Open Outlook

Delete Old Calendar Events using VBA

VBA Basics

How to use the VBA Editor

Work with open item or selected item

Working with All Items in a Folder or Selected Items

VBA and non-default Outlook Folders

Backup and save your Outlook VBA macros

Get text using Left, Right, Mid, Len, InStr

Using Arrays in Outlook macros

Use RegEx to extract message text

Paste clipboard contents

Windows Folder Picker

Custom Forms

Designing Microsoft Outlook Forms

Set a custom form as default

Developer Resources

Developer Resources

Developer Tools

VBOffice.net samples

SlovakTech.com

Outlook MVP David Lee

Repair PST

Convert an OST to PST

Repair damaged PST file

Repair large PST File

Remove password from PST

Merge Two Data Files

Sync & Share Outlook Data

  • Share Calendar & Contacts
  • Synchronize two computers
  • Sync Calendar and Contacts Using Outlook.com
  • Sync Outlook & Android Devices
  • Sync Google Calendar with Outlook
  • Access Folders in Other Users Mailboxes

Diane Poremsky [Outlook MVP]

Make a donation

Mail Tools

Sending and Retrieval Tools

Mass Mail Tools

Compose Tools

Duplicate Remover Tools

Mail Tools for Outlook

Online Services

Calendar Tools

Schedule Management

Calendar Printing Tools

Calendar Reminder Tools

Calendar Dates & Data

Time and Billing Tools

Meeting Productivity Tools

Duplicate Remover Tools

Productivity

Productivity Tools

Automatic Message Processing Tools

Special Function Automatic Processing Tools

Housekeeping and Message Management

Task Tools

Project and Business Management Tools

Choosing the Folder to Save a Sent Message In

Run Rules on messages after reading

Help & Suggestions

Submit Outlook Feature Requests

Slipstick Support Services

Buy Microsoft 365 Office Software and Services

Visit Slipstick Forums.

What's New at Slipstick.com

Home | Outlook User | Exchange Administrator | Office 365 | Outlook.com | Outlook Developer
Outlook for Mac | Common Problems | Utilities & Addins | Tutorials
Outlook & iCloud Issues | Outlook Apps
EMO Archives | About Slipstick | Slipstick Forums
Submit New or Updated Outlook and Exchange Server Utilities

Send comments using our Feedback page
Copyright © 2025 Slipstick Systems. All rights reserved.
Slipstick Systems is not affiliated with Microsoft Corporation.

:wpds_smile::wpds_grin::wpds_wink::wpds_mrgreen::wpds_neutral::wpds_twisted::wpds_arrow::wpds_shock::wpds_unamused::wpds_cool::wpds_evil::wpds_oops::wpds_razz::wpds_roll::wpds_cry::wpds_eek::wpds_lol::wpds_mad::wpds_sad::wpds_exclamation::wpds_question::wpds_idea::wpds_hmm::wpds_beg::wpds_whew::wpds_chuckle::wpds_silly::wpds_envy::wpds_shutmouth:
wpDiscuz

Sign up for Exchange Messaging Outlook

Our weekly Outlook & Exchange newsletter (bi-weekly during the summer)






Please note: If you subscribed to Exchange Messaging Outlook before August 2019, please re-subscribe.

Never see this message again.

You are going to send email to

Move Comment