Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best way to extract attachments from a MSG file
Message
De
03/02/2009 03:56:03
 
 
À
03/02/2009 02:00:53
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Web
Divers
Thread ID:
01378889
Message ID:
01378922
Vues:
18
In my quest to get attachments from a .MSG file, I have tried this code:
        Dim loMessage As New CDO.Message
        Dim loStream As New ADODB.Stream

        loStream.Mode = ADODB.ConnectModeEnum.adModeReadWrite
        loStream.Type = ADODB.StreamTypeEnum.adTypeText
        loStream.Open()

        loStream.WriteText(oApp.FileToStr("d:\Test.msg"), ADODB.StreamWriteEnum.adWriteLine)

        loStream.Position = 0

        loMessage.DataSource.OpenObject(loStream, "_Stream")

        MessageBox.Show(loMessage.From)
        MessageBox.Show(loMessage.To)
        MessageBox.Show(loMessage.TextBody)
While this doesn't generate any error, it doesn't recognize the content of the file. Basically, all properties from loMessage return empty.

There has to be a small ajustment that has to be made in this code. I just can't find where it is.

Basically, I create a stream. Then, I use that into loMessage.DataSource.OpenObject() to have it into a CDO.Message. Is there anyone who would see what has to be adjusted?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform