dc88310
11-06-2013, 10:05 AM
Greetings!
I will start by saying i am not a VBA expert by any stretch of the imagination. I have some code that i currently use to take an email attachment and save it to my network. It works perfectly for the attachments i am moving over.
My current code, I have as a module (For reference)
Sub saveAttachtoDisk(itm As Outlook.MailItem)Dim objAtt As Outlook.Attachment
Dim saveFolder As String
saveFolder = "\\safedata\public\Virtual_Org\Process_Improvement\Chat"
For Each objAtt In itm.Attachments
objAtt.SaveAsFile saveFolder & "\" & objAtt.DisplayName
Set objAtt = Nothing
Next
End Sub
Then I have a rule in Outlook that when these emails come in, it will automatically take the attachment and move it to the specified location. It works flawlessly.
Here is the issue: I have another email I want to do the same exact thing for, except the attachment in the new email i receive is zipped. I am not sure how to extract the zip file based on this code... but what i want to do.. is extract it... then once extracted save it to my network with a name that i specify.
Can anyone help me tweak this code to accomplish this? I have searched the forums and nothing i have read makes sense.
DC
I will start by saying i am not a VBA expert by any stretch of the imagination. I have some code that i currently use to take an email attachment and save it to my network. It works perfectly for the attachments i am moving over.
My current code, I have as a module (For reference)
Sub saveAttachtoDisk(itm As Outlook.MailItem)Dim objAtt As Outlook.Attachment
Dim saveFolder As String
saveFolder = "\\safedata\public\Virtual_Org\Process_Improvement\Chat"
For Each objAtt In itm.Attachments
objAtt.SaveAsFile saveFolder & "\" & objAtt.DisplayName
Set objAtt = Nothing
Next
End Sub
Then I have a rule in Outlook that when these emails come in, it will automatically take the attachment and move it to the specified location. It works flawlessly.
Here is the issue: I have another email I want to do the same exact thing for, except the attachment in the new email i receive is zipped. I am not sure how to extract the zip file based on this code... but what i want to do.. is extract it... then once extracted save it to my network with a name that i specify.
Can anyone help me tweak this code to accomplish this? I have searched the forums and nothing i have read makes sense.
DC