Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting HTML page into an email
Message
De
27/01/2009 11:36:48
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01377350
Message ID:
01377362
Vues:
14
>This is completely new to me. Is CDO namespace part of .NET framework? Do you create your HTML page and then use this CDO.Message to convert it? It would be helpful if you could provide pseudo steps you perform in this process (in a brief summary). Thank you.

I will have an article on this in the upcoming Level Extreme .NET Magazine. In overall, it's pretty simple. You simple add the namespace in your class. Then, you call the CreateMHTMLBody() method with the URL. That will save it to where you have indicated it. The following example is a short summary. It only includes the basic stuff:
Imports CDO
Imports ADODB

    Public Class MHTML

        Public cMHTMLUrl As String = ""
        Public cSaveFile As String = ""

        ' CDO message object
        Private oMessage As CDO.Message = New CDO.Message

        ' Get the MHTML file
        Public Function GetMHTML() As Boolean
            Dim llSuccess As Boolean = False
            Dim loStream As ADODB.Stream

            ' Go get the page
            oMessage.CreateMHTMLBody(cMHTMLUrl, CDO.CdoMHTMLFlags.cdoSuppressNone, "", "")

            loStream = oMessage.GetStream()

            ' Save to file
            loStream.SaveToFile(cSaveFile, SaveOptionsEnum.adSaveCreateOverWrite)

            llSuccess = True
            Return llSuccess
        End Function

    End Class
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