I found the below codes work for me:
Dim oAttachs As Ol.Attachments = oMsg.Attachments
Dim oAttach As Ol.Attachment
Debug.WriteLine("ATTACHED FILE: " &
oAttachs.Count)
If oAttachs.Count > 0 Then
For Each oAttach In oAttachs
'Dim file As New
System.IO.StreamWriter("c:\temp\mt940_test.txt", True)
Try
oAttach.SaveAsFile("c:\temp\mt940_test.txt")
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try
'file.WriteLine(oAttach.DisplayName)
'file.Close()
Next
End If
"Li Pang" wrote:
Hi,
I receive daily an email with a attached file from my Outlook inbox. This
file must be saved into a specific location manually. I made an app to
automate this process.
My app can read the emails from the inbox folder, I can catch all properties
of the emails. I want to know how to save the attached file into a specific
location.
Anyone can give a help?
Thanks in advance