We received about 15 reports from various sources each day to our reporting mailbox. I have created Outlook VBA scripts, which are run from a message rule, to save each report from the emails to the relevant network folder (for different projects). I have a few questions on extracting and renaming the attachments:

1. How can I extract a file from an attachment with VBA to a specific folder? Example name is "report_20170831070501.zip"

2. How can I rename the file to remove the last 2 characters? Example name is report_20170831070501.csv - so would like to remove the "01", as in the seconds.

3. How can I rename the file of another report to remove the timestamp at the end of the name but keep the datestamp? Timestamp in hh-mm-ss format, example name of report is "This Report_2017-08-31-05-41-56.xlsx".

I normally use Name "this name", "to this name" to rename files and I guess it's something like left(oFile.name,2) to remove the ends but I can't figure out how to put these together to rename and remove the ends.

If you need any further info from me, just shout.

Ta.