In questo percorso c:\temp\
ho il file pippo.eml che contiene postacert.eml e all'interno contiene il file pdf.
Il mio compito è quello di estrarre il pdf e salvare.
Dopo che ho navigato un bel pò, ho trovato questo pezzo di codice:
codice:
Imports CDO
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim strm As ADODB.Stream
Dim myMail As New CDO.Message
Dim attach As IBodyPart
strm = myMail.GetStream
strm.Type = ADODB.StreamTypeEnum.adTypeText
strm.LoadFromFile("c:\temp\pippo.eml")
strm.Flush()
For Each attach In myMail.Attachments
attach.SaveToFile("c:\temp\" & attach.FileName)
Next
End Sub
End Class
Arriva fino al For Each attach In myMail.Attachments mi restituisce 0 cioè non ci sono allegati.
Qualcuno di voi ha idea????
Grazie
Ciao