I have to process incoming mail and then save some xls-attachments as files. So, I get all attachments as
For Each att In mail.Attachments
(I really have all the attachments in att
objects - I checked it by comparing att.FileName
property with my attachment's names - it's ok.) But when I try to save my attachments as files, for example like this:
att.SaveAsFile "C:\test.xls"
The files are created, but they are always empty. Source files in attachments contain some data, text and pictures, but the saved files are empty.
att
and mail
and how you are getting those references - JimmyPena 2012-07-06 18:59
It's hard to tell from your code what the problem might be. Using Outlook 2003, I got this to work just fine for any/all .xls attachments...
Sub TestSub()
Dim mail As Outlook.Inspector
Dim att As Variant
Set mail = Application.ActiveInspector
For Each att In mail.CurrentItem.Attachments
att.SaveAsFile "P:\test.xls"
Next att
End Sub