Hello - This is my first post on this forum so please forgive my ignorance - I'm trying to modify an old macro that I was given. The original macro would walk through all the emails in a user specified folder in their inbox and then ask the user where they wanted to save the emails (BrowseForFolder) and it would walk through all the folders and subfolders and save the emails in the same folder structure as was in Outlook to a network or hard drive with the name of the .msg file as YYYY-MM-DD_HH-MM-SS_subject.msg where the date and time was the mItem.ReceivedTime.
Now I want this macro to ask me for two dates to create a date range to apply to the mail items that are being saved. So for instance, let's say I have emails in folders and subfolders dating back to 2017. I want to run this macro and have it ask me for a date range so I can tell it to only save emails from 1/1/2017 to 12/31/2017. Once it's finished I then will run it again for emails from 1/1/2018 to 12/31/2018. So on and so forth.
The original code is attached, you can see my coding attempts commented out about 80 lines down or so:
Now I want this macro to ask me for two dates to create a date range to apply to the mail items that are being saved. So for instance, let's say I have emails in folders and subfolders dating back to 2017. I want to run this macro and have it ask me for a date range so I can tell it to only save emails from 1/1/2017 to 12/31/2017. Once it's finished I then will run it again for emails from 1/1/2018 to 12/31/2018. So on and so forth.
The original code is attached, you can see my coding attempts commented out about 80 lines down or so: