Hi,
how can I modify this vba code to just download the following attachments when email is receive, format like .pdf, .xlsx, .doc and .zip format?
this is the code I have now:
thank you
how can I modify this vba code to just download the following attachments when email is receive, format like .pdf, .xlsx, .doc and .zip format?
this is the code I have now:
VBA Code:
Public Sub saveAttachtoDiskNew(itm As Outlook.MailItem)
Dim objAtt As Outlook.Attachment
Dim saveFolder As String
Dim dateFormat
dateFormat = Format(Now, "yyyy-mm-dd H-mm")
saveFolder = "C:\EMAIL_ATTACHMENTS"
For Each objAtt In itm.Attachments
objAtt.SaveAsFile saveFolder & "\" & dateFormat & objAtt.DisplayName
'objAtt.SaveAsFile saveFolder & "\" & objAtt.DisplayName
Set objAtt = Nothing
Next
End Sub
thank you