Sub SaveCSVToDisk(Item As Outlook.MailItem)
Dim olkFile As Outlook.Attachment
For Each olkFile In Item.Attachments
'Change the file name on the following line'
If Right(LCase(olkFile.FileName, 3)) = "csv" Then
'Change the path the file will be saved to on the following line'
olkFile.SaveAsFile "C:\" & olkFile.FileName
End If
Next
Set olkFile = Nothing
End Sub
|