How to change the Attachment File Name?

Status
Not open for further replies.

geofferyh

Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
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

geofferyh

Member
Outlook version
Outlook 2010 32 bit
Email Account
POP3
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"
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
U Exchange 2010 change attachment file limit Exchange Server Administration 2
J Auto Forward - Include Attachment and change Subject depending on original sender Outlook VBA and Custom Forms 3
D Attachment renamed or exention change in error Using Outlook 2
W Recurrence: delete older occurrences / change earliest start time Outlook VBA and Custom Forms 0
E Change sending account depending on Subjectline Outlook VBA and Custom Forms 0
J Outlook 2013 Change color of text in data fields of contacts in Outlook 2013? Using Outlook 3
B Change row background color of selected item Using Outlook 1
PGSystemTester VBA To Change AppointmentItem.BusyStatus From MeetingItem Before Send Using Outlook 0
B Change from Address Outlook VBA and Custom Forms 0
X If you change expiration date of repeated task it dupplicates Using Outlook 1
E How to display "Change Folder" in Change Default Email Delivery Location in Exchange Outlook 2016 Using Outlook 1
B See "Change View" Drop Down as a List? Using Outlook 1
V Change start time based on message duration Outlook VBA and Custom Forms 2
R Folder pane width change Using Outlook 52
S Change VBA script to send HTML email instead of text Outlook VBA and Custom Forms 3
S Outlook 2010 unable to change default font Using Outlook 7
P How can I change my calendar view back Using Outlook 3
A Edit subject - and change conversationTopic - using VBA and redemption Outlook VBA and Custom Forms 2
T Change the selected Message in the Outlook window Outlook VBA and Custom Forms 2
W Appointment occurrences change the location property Using Outlook 0
T Scheduled footer change Using Outlook 2
B Change font of reminder of an email header Outlook VBA and Custom Forms 3
CWM030 Name Change? Exchange Server Administration 9
V not able to change name in customize Ribbon Outlook VBA and Custom Forms 1
JoeG Appointment Delete/Change Recurrence Outlook VBA and Custom Forms 0
C Change Subject Line in Selected Emails Outlook VBA and Custom Forms 1
V Change default default save location to Quick Access Using Outlook 1
C Change default "Save Sent Item To" folder Outlook VBA and Custom Forms 9
S Example VBA Macro - To Conditionally Change the From Account and Add a BCC Address on Emails Outlook VBA and Custom Forms 11
B Do not change the From address in Outlook Templates Using Outlook 0
M Sudden change in From field - now very short Using Outlook 4
M cannot change delivery folders with IMAP accounts Using Outlook 0
S Email Format With Embedded Images and Tables Change Using Outlook 2
O On click,I want to change subject line of selected mail and then reply to particular email and move Using Outlook 3
P Change PC User Directory & iPhone Sync Using Outlook 2
A Change order of actions in one (!) rule Outlook VBA and Custom Forms 2
I change subject and forward without FW: Outlook VBA and Custom Forms 4
Rupert Dragwater Can't change font size Using Outlook 5
M VBA to change flag status in outlook contact item Outlook VBA and Custom Forms 3
tjd189 outlook 2016 name change Using Outlook 1
E Button to change subject Outlook VBA and Custom Forms 1
K Paste from Windows Clipboard then change font without losing formatting Outlook VBA and Custom Forms 1
D Office365 Conference Room name change? Using Outlook 5
J Change POP account to Forwarder - What happens in Outlook? Using Outlook 2
H Change Default Email Account Using VBA Outlook VBA and Custom Forms 5
C Change default colors for conditional formatting Using Outlook 2
O VBA to Run Font Change on Outlook Startup Outlook VBA and Custom Forms 4
K Other Shared Calendar on Outlook cannot change items Using Outlook.com accounts in Outlook 7
Diane Poremsky How to Easily Change the Private Flag New Slipstick.com Articles 0
Diane Poremsky How to Change the Font used for Outlook's RSS Feeds New Slipstick.com Articles 0
Similar threads


















































Top