-
-
Save 54437698/66803c763e442294a588917ddace7eb9 to your computer and use it in GitHub Desktop.
Outlook Unified Inbox Macro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ' This macro creates a "unified inbox" - a search across all inboxes and sent items. | |
| ' Steps to use it: | |
| ' 1. Enable developer tab to see VBA console: | |
| ' Options > Customize Ribbon > | |
| ' Enable the selection field before “Developer” and OK. | |
| ' 2. Add macro: | |
| ' From the Developer tab open Visual Basic dialog | |
| ' Open VBA Add the Sub below to General context | |
| ' 3. Enable macros: | |
| ' Options > Trust Center > Trust Center Settings > Macro Settings | |
| ' Choose 'Notifications for all macros' and OK. | |
| ' 4. Add the macro to Quick Access Toolbar: | |
| ' Options > Quick Access Toolbar | |
| ' Choose commands from 'Macros' | |
| ' Select the macro 'Project1.ThisOutllokSession.UnifiedInbox' and [add] it to the right side pane. | |
| ' Select [Modify] and choose an icon and display name. and OK. | |
| Sub UnifiedInbox() | |
| Dim myOlApp As New Outlook.Application | |
| Dim tDate As Date | |
| tDate = Date - 14 '7 days ago | |
| txtSearch = "folder:Inbox received:(>" & tDate & ")" & " OR folder:Sent sent:(>" & tDate & ")" | |
| myOlApp.ActiveExplorer.Search txtSearch, olSearchScopeCurrentFolder | |
| myOlApp.ActiveExplorer.Search txtSearch, olSearchScopeAllFolders | |
| Set myOlApp = Nothing | |
| End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment