I am curious to know if this is possible.
I receive invoices daily. I have a batch file which creates a folder everyday displayed as (mm - dd - yyyy).
My goal is to create a macro which moves emails to their designated folders, which is located on my hard drive, everyday.
For example, all email received today would be moved to a folder labeled 05-01-2015
. And then emails I received tomorrow would go into a folder labeled 05-02-2015
. Mind you that the way the folders are being created is through a batch file which will run everyday.
To process incoming emails you need to handle the NewMailEx event or create a rule which can run a VBA macro sub. The VBA macro sub should look like the following one:
public sub test(mail as MailItem)
' do whatever you need
end sub
In the code you can check out the current date and find the corresponding folder, then move the incoming mail item to the target folder.
I'd suggest starting from the Getting Started with VBA in Outlook 2010 article.