473,387 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Page save as .mht file

1
Hi

I use this

Expand|Select|Wrap|Line Numbers
  1. Set ObjIE = CreateObject("InternetExplorer.Application")
  2. ObjIE.Visible = True
  3. ObjIE.Navigate2 "http://www.google.dk/search?hl=da&q= test &meta="
  4.     'Wait till the page is completely displayed!
  5.     'The following three lines are not needed if
  6.     'you don't want to wait for the 1st page to display completely
  7.     While ObjIE.ReadyState < 4
  8.         Sleep 100
  9.     Wend
Can I save the page as .mht file ?
Jul 9 '07 #1
1 3699
Killer42
8,435 Expert 8TB
I did a Google search for "VB SAVE MHT" and found tons of entries (around 88,000). Just glancing through the first page, most seem to be talking about software you can obtain to do it. However, I found this on another forum. It sounds as though it might be some help. If not, try the Google search and see what you can come up with.

Quoting...

Expertise: Advanced
Language: .NET

June 26, 2007

Save a URL as an MHT File
To save a URL as an MHT file (Microsoft "Multipurpose Internet Mail Extension HTML"—a Web Archive File), reference the Microsoft ActiveX Data Objects 2.7 and Microsoft CDO libraries and use the following code:

Expand|Select|Wrap|Line Numbers
  1. void SaveWebPageToMHTFile( string url, string filePath)
  2. {
  3.    CDO.Message msg = new CDO.MessageClass(); 
  4.    ADODB.Stream stm = null ;
  5.    msg.MimeFormatted =true;   
  6.    msg.CreateMHTMLBody(url, 
  7.       CDO.CdoMHTMLFlags.cdoSuppressNone, 
  8.       "" ,"" );
  9.    stm = msg.GetStream();
  10.    stm.SaveToFile(filePath, 
  11.       ADODB.SaveOptionsEnum.adSaveCreateOverWrite);
  12.    msg=null;
  13.    stm.Close();
  14. }
Srinath MS
Jul 10 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Prakashsir | last post by:
I have desgined script to show div at runtime. Now I want to copy that newly created div and/or to save in normal html file so that i can see later. 1. When I select all the content or view its...
4
by: Glenn M | last post by:
I have a shared XML file on a server . i also have one xslt file that performs a simple transform on in to view the data. now i want to have another page that lets users modify the shared xml...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
3
by: fiefie.niles | last post by:
I would like to save a web page to a file and have the hyperlinks work when I bring the file back up. If the web page has a hyperlink like the following <a href="OurWeb/News/abcFile.htm">, after...
3
by: fiefie.niles | last post by:
I would like to save a web page to a file. When I do that, sometimes the saved web page does not look like the original web page. For example, when I save www.msn.com, it looks very different the...
1
by: vj | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file? I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
12
by: =?Utf-8?B?RnJlZU5FYXN5?= | last post by:
Hello, the scenario: There's an ASPX page which shows some text and has three buttons at the bottom: Save, Print and Close. Print and close is done by javascript. But how can I save the page...
6
scubak1w1
by: scubak1w1 | last post by:
Hello, I have been Googling for a bit now as to how to let the user save the current page via a 'clickable icon' to an HTML file (i.e., on the client side.) That is, I am presenting a lot of...
3
by: premprakashbhati | last post by:
hi, good evening.. i am going to upload an image in a web form .....for that iam using HTML input(file) control and one web control button i.e., Upload_Button() here is the code ...its work fine...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.