Results 1 to 6 of 6

Thread: Saving MHTML from the Webbrowser Object

  1. #1

    Thread Starter
    Fanatic Member Kzin's Avatar
    Join Date
    Dec 2000
    Posts
    611

    Cool

    Does anyone know how I can saving MHTML from the Webbrowser to make .mht files?

    I know that this is pushing things a bit but it means that apps can wrap-up whole web pages into single files which would be very useful!


  2. #2
    Banned
    Join Date
    Feb 2001
    Location
    Back to sh*tland
    Posts
    294
    This post is old, but... does anyone knows how to do it?

  3. #3
    Banned
    Join Date
    Feb 2001
    Location
    Back to sh*tland
    Posts
    294

    Post Ok...

    Since no one replied I'll post what I found these days. I don't know if there is some one interested in this besides Kzin. Here is what I found useful for doing this:
    • Save the Last Gif for Me - How to save the images from a Web Page.
    • MHTML - "This class demonstrates how to send MHTML email. It has a very simple interface which allows you to send HTML formatted email with 2 method calls."
    Maybe there's a simpler way to do this instead of joining these two codes, but for now I suppose it's possible to do it just with this.

    Later,

  4. #4

    Thread Starter
    Fanatic Member Kzin's Avatar
    Join Date
    Dec 2000
    Posts
    611
    Thanks David!

  5. #5

    Thread Starter
    Fanatic Member Kzin's Avatar
    Join Date
    Dec 2000
    Posts
    611

    Re: Ok...

    Originally posted by Good Dreams
    Since no one replied I'll post what I found these days. I don't know if there is some one interested in this besides Kzin. Here is what I found useful for doing this:
    • Save the Last Gif for Me - How to save the images from a Web Page.
    • MHTML - "This class demonstrates how to send MHTML email. It has a very simple interface which allows you to send HTML formatted email with 2 method calls."
    Maybe there's a simpler way to do this instead of joining these two codes, but for now I suppose it's possible to do it just with this.

    Later,
    Looking at these further they still don't take me to where I need to be

    what I need is to convert a "Source File" which might be HTML with images or with any of a range of 'embedded' media types (MP3, Shockwave etc) and save as a self contained MHTML file. You can do this manually from a browser but it does not seem to be possible using Webbrowser which is a pain as I need to do this transparently.

    Looking for a friendly intelligent chat forum? Visit the white-hart.net

  6. #6
    Lively Member
    Join Date
    Apr 2007
    Location
    Gold Coast, Australia
    Posts
    71

    Re: Saving MHTML from the Webbrowser Object

    Hi,

    i use this method to create a mth file (web archive) from the contents of a richtextbox which works fine...

    Dim wrd As Object
    Const wdFormatFilteredHTML = 9
    On Error Resume Next
    Kill App.path & "\YourQuote.mth"
    Kill App.path & "\temprtf.rtf"

    On Error GoTo 0
    'save the rtf file
    DoEvents
    Rtb2.SaveFile App.path & "\tempRtf.rtf", 0
    DoEvents
    'convert the rtf file to html format using msword
    Screen.MousePointer = vbHourglass
    Set wrd = CreateObject("Word.Application")
    wrd.Documents.Open App.path & "\tempRtf.rtf"
    wrd.Documents("tempRtf.rtf").SaveAs App.path & "\YourQuote.mth", wdFormatFilteredHTML
    DoEvents
    wrd.Quit
    Set wrd = Nothing

    If you double click the saved file in windows explorer it opens in the browser just fine but if try and email it as an attachment it won't open properly if there are any images?

    Can someone help with this little problem?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width