I found the below codes work for me:
Dim oAttachs As Ol.Attachments = oMsg.Attachment s
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.Strea mWriter("c:\tem p\mt940_test.tx t", True)
Try
oAttach.SaveAsF ile("c:\temp\mt 940_test.txt")
Catch ex As Exception
MsgBox(ex.Messa ge.ToString)
End Try
'file.WriteLine (oAttach.Displa yName)
'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