Create date folder and move messages daily

andrez

New Member
Outlook version
Outlook 2016 64 bit
Email Account
Office 365 Exchange
Hi !

I need to create the folder with the date of the day and move messages from that day to this folder from the inbox. Thank you very much for your help.

datefolder.PNG
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
The macro on this page will get you close - Use a Macro to Move Aged Email in Outlook you just need to create the folders.

This should create the folder as a subfolder of the inbox - replace
Set objDestFolder = objSourceFolder.Folders("Old")

with it
Code:
On Error Resume Next
strDate = Format(Date, "mmm dd yyyy")
Set objDestFolder = objSourceFolder.Folders(strDate )
 
If objDestFolder Is Nothing Then
    Set objDestFolder = objSourceFolder.Folders.Add(strDate )
End If
 
Top