Dear all,
I need to save the file with specific date & time mentioned inside the txt file
I am using the below code to save the file into my drive but want to accomplish different naming method
Want to consider the file name as "12-01-21_08:09:08" which is mentioned at right corner as Date & time inside the txt file (attached)
Date & time is given like below in txt file
Date 12-Jan-2021
Time 08:09:08 (EST)
want the file name as below date 12-01-21 & time 08:09:08 combined like like (dd-mm-yy_hh:mm:ss)
12-01-21_08:09:08
code modification required to get the file name as desired
-----------------
Sub saveAttachZFI2B047(itm As Outlook.MailItem)
Dim objAtt As Outlook.Attachment
Dim saveFolder As String
Dim mydate As String
mydate = Format(Date, "yymmdd")
saveFolder = "C:\Users\\Documents\ZFI2B047"
For Each objAtt In itm.Attachments
objAtt.SaveAsFile saveFolder & mydate & objAtt.DisplayName
Set objAtt = Nothing
Next
End Sub
----------
I have attached my example file, this is to make files saved as per SAP job date & time which is my requirement. Pls some one see if this can be accomplished. Thank you
regards
subhash
I need to save the file with specific date & time mentioned inside the txt file
I am using the below code to save the file into my drive but want to accomplish different naming method
Want to consider the file name as "12-01-21_08:09:08" which is mentioned at right corner as Date & time inside the txt file (attached)
Date & time is given like below in txt file
Date 12-Jan-2021
Time 08:09:08 (EST)
want the file name as below date 12-01-21 & time 08:09:08 combined like like (dd-mm-yy_hh:mm:ss)
12-01-21_08:09:08
code modification required to get the file name as desired
-----------------
Sub saveAttachZFI2B047(itm As Outlook.MailItem)
Dim objAtt As Outlook.Attachment
Dim saveFolder As String
Dim mydate As String
mydate = Format(Date, "yymmdd")
saveFolder = "C:\Users\\Documents\ZFI2B047"
For Each objAtt In itm.Attachments
objAtt.SaveAsFile saveFolder & mydate & objAtt.DisplayName
Set objAtt = Nothing
Next
End Sub
----------
I have attached my example file, this is to make files saved as per SAP job date & time which is my requirement. Pls some one see if this can be accomplished. Thank you
regards
subhash