Hello everyone,
I have a macro in Outlook that instructs the file to be downloaded and saved under a specified name format. The challenge I am facing is that it is a .zip file with an Excel document inside. Eventually I need to get hold of the Excel file inside. How do I instruct the outlook to unzip the file and then save its contents under a specified name. Thank you.
I have a macro in Outlook that instructs the file to be downloaded and saved under a specified name format. The challenge I am facing is that it is a .zip file with an Excel document inside. Eventually I need to get hold of the Excel file inside. How do I instruct the outlook to unzip the file and then save its contents under a specified name. Thank you.
VBA Code:
Public Sub SaveAutoAttach(item As Outlook.MailItem)
Dim object_attachment As Outlook.Attachment
Dim saveFolder As String
'Folder location
saveFolder = "H:\MyFile_" & Format(item.ReceivedTime, "yyyymmdd") & ".zip"
For Each object_attachment In item.Attachments
object_attachment.SaveAsFile saveFolder
Next
End Sub