Saving web pages as mht

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Von Shean

    #1

    Saving web pages as mht

    I have a requirement to save web pages from a different site on to my server
    as mht files ...and later i would need to email them to different
    recipients.

    I am using c# for my development.
    Email part is easy but i have no clue how to do the saving as mht thing.
    can any one suggest how can this happen....?

    Regards,


  • Peter Rilling

    #2
    Re: Saving web pages as mht

    I project that I inherited at work create MHT files for web pages. The way
    that our system does it is that we use the CDO object (interop) which has
    facilities for creating MHT files.

    Alternatively (which is how our program should be doing it), you would pull
    each file from the website (using something like the HttpWebRequest class)
    and package it in an MHT. I believe the MHT has a standard text format
    (basically a multipart document). You could package all the content into
    this file.

    "Von Shean" <vonshean@hotma il.com> wrote in message
    news:%23qQNNMdo DHA.2012@TK2MSF TNGP12.phx.gbl. ..[color=blue]
    > I have a requirement to save web pages from a different site on to my[/color]
    server[color=blue]
    > as mht files ...and later i would need to email them to different
    > recipients.
    >
    > I am using c# for my development.
    > Email part is easy but i have no clue how to do the saving as mht thing.
    > can any one suggest how can this happen....?
    >
    > Regards,
    >
    >[/color]


    Comment

    • Von Shean

      #3
      Re: Saving web pages as mht

      Thanks..

      I tried out what you said..i used the following code
      CDO.MessageClas s message = new CDO.MessageClas s();

      message.CreateM HTMLBody("http://www.google.com/",

      CDO.CdoMHTMLFla gs.cdoSuppressN one, "", "");

      ADODB.Stream stream = message.GetStre am();

      stream.SaveToFi le("fanms.mht" ,
      ADODB.SaveOptio nsEnum.adSaveCr eateOverWrite);


      but i keep getting 'Interface not supported at CreateMHTMLBody ...

      any clues to this........

      Regards


      "Peter Rilling" <peter@nospam.r illing.net> wrote in message
      news:#VgjbHeoDH A.2512@TK2MSFTN GP09.phx.gbl...[color=blue]
      > I project that I inherited at work create MHT files for web pages. The[/color]
      way[color=blue]
      > that our system does it is that we use the CDO object (interop) which has
      > facilities for creating MHT files.
      >
      > Alternatively (which is how our program should be doing it), you would[/color]
      pull[color=blue]
      > each file from the website (using something like the HttpWebRequest class)
      > and package it in an MHT. I believe the MHT has a standard text format
      > (basically a multipart document). You could package all the content into
      > this file.
      >
      > "Von Shean" <vonshean@hotma il.com> wrote in message
      > news:%23qQNNMdo DHA.2012@TK2MSF TNGP12.phx.gbl. ..[color=green]
      > > I have a requirement to save web pages from a different site on to my[/color]
      > server[color=green]
      > > as mht files ...and later i would need to email them to different
      > > recipients.
      > >
      > > I am using c# for my development.
      > > Email part is easy but i have no clue how to do the saving as mht thing.
      > > can any one suggest how can this happen....?
      > >
      > > Regards,
      > >
      > >[/color]
      >
      >[/color]


      Comment

      Working...