Outlook 2010 How to change the Attachment File Name?

Outlook version
Outlook 2010 32 bit
Email Account
POP3
#1
The attached VBA macro works with Outlook 2010 Rules, saving the attachment in reservation messages that meet the condition of the rule. The macro saves an Excel .csv file attachment to a very specific location, that being: C:/MarinaPro/ResScheduler/.

I need to change the original .csv file name (Example: 11485_9301_14-12-2018_15-29-51.csv ) before it is copied to the ResScheduler folder. The new file name needs to be formatted as, for example, "121418_1030_CUSTLASTNAM.csv". Where the date and time reference is the "Sent" date and time of the email reservation message.

Just cannot get it to work.
 

Attachments

Outlook version
Outlook 2010 32 bit
Email Account
POP3
#2
The attached VBA macro works with Outlook 2010 Rules, saving the attachment in reservation messages that meet the condition of the rule. The macro saves an Excel .csv file attachment to a very specific location, that being: C:/MarinaPro/ResScheduler/.

I need to change the original .csv file name (Example: 11485_9301_14-12-2018_15-29-51.csv ) before it is copied to the ResScheduler folder. The new file name needs to be formatted as, for example, "121418_1030_CUSTLASTNAM.csv". Where the date and time reference is the "Sent" date and time of the email reservation message.

Just cannot get it to work.
After a bit more time I got this one worked out on my own. Here's solution:

'Get the SentOn Date and Time
DateFormat = Format(Date, "MMddyy")
TimeFormat = Format(Time, "HHmm")

' Get the reservation file name.
strFile = DateFormat & "_" & TimeFormat & "_" & "CustLastNam.csv"
 

Similar threads

Top