View Single Post
 
Old 09-30-2020, 05:02 PM
benobi benobi is offline Windows 10 Office 2019
Novice
 
Join Date: Sep 2020
Posts: 2
benobi is on a distinguished road
Default Macro search query for past 4 weeks?

Hi there

I've set up a macro in an attempt to have a Unified inbox view across my 2 work email accounts in Outlook O365.

The macro is:

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

My question is this - is there a query to return search results for the 'last 4 weeks'? Or past 30 days? Or equivalent?

I can only see this week, last week, this month, last month, this year, last year as the standard variables. These are pretty restrictive and a bit shortsighted - for example if I use 'this month' at the start of the month (like today for example) I get next to no results.

Any help would be greatly appreciated.

Cheers

Ben
Reply With Quote