September 13, 2004
I just posted another CodeProject article, Convert any URL to a MHTML archive using native .NET code. The title is a bit misleading; using my class, you can actually convert any URL to one of four formats in a single line of code:
- Web Page, complete (HTML plus files in subfolder)
- Web Archive, single file (MHTML only)
- Web Page, HTML only (HTML only)
- Text File (TXT only)
This mimics the File | Save As menu in Internet Explorer
as closely as I could get it to. It's pretty darn close, and quite handy. We are using IE as a basic reporting engine, and it's a lot easier to email someone a report-- or store it in a document management system-- when you have a single MHTML file!
I knew IE had some crazy way of saving a complete web page as a single file, but I was as surprised as anyone else to find that IE's "Web Archive" save option is based on an actual internet standard: RFC standard 2557, compliant Multipart MIME Message (MHTML web archive). As I mentioned a few months ago, this should work in Firefox, too..
Posted by Jeff Atwood
Firefox does NOT have MHT capability. It is planned but not yet implemented.
BTW, I posted a comment on the codeproject site
about this article. Had a chance to look at it?
why open the mht file use your code to genereate with word 2003, it shows error, not a collect mht file, what's the problem?