We help IT Professionals succeed at work.

save the content of current page of IE

shineway
shineway asked
on
I know I can add a button into Internet Explorer's toolbar. The button can invoke a COM dll to perform sth.

My question is how to write a COM dll of this kind, when invoked, it can save all the content of current page of IE, including the html source code, images,flashes,etc.,into local files?
Comment
Watch Question

CERTIFIED EXPERT
Author of the Year 2009

Commented:
Just in case you don't know this, it is possible to do that without any programming.  Just click Favorites, and Add to Favorites and put a check in "make available offline"

You will find a number of difficulties in doing it programatically, not the least of which is having to track down each image and flash and activeX and stylesheet and XML reference etc... and saving those while also updating the source html so that each reference will get the image from a local directory and not try to pull it from orginal URL on the Internet.

I, too, would be interested in seeing a good, complete programmable implementation of this idea in source code (there are some snareware shareware packages available).

But I'll be surprised if 300 points will buy you 100 hours worth of a top programmer's time.

-- Dan
CERTIFIED EXPERT
Top Expert 2012
Commented:
See http://support.microsoft.com/support/kb/articles/Q292/4/85.ASP ('HOWTO: Programmatically Save an HTML Page to Disk'). The scoop is:

Accomplishing this task from a Visual C++ host is very straightforward. You can use an IWebBrowser2 interface to call the QueryInterface method for the IHTMLDocument2 interface. After you obtain a pointer to the document, then call QueryInterface for the IPersistFile interface. After you obtain this interface pointer, you can call the save method to save the file to disk.

    HRESULT          hr    = E_FAIL;
    IDispatch*       pDisp = NULL;
    IHTMLDocument2*  pDoc  = NULL;
     
    pDisp                  = m_webOC.GetDocument();

   if(SUCCEEDED(hr = pDisp->QueryInterface(IID_IHTMLDocument2,(void**)&pDoc)))
   {
       IPersistFile*     pFile     =     NULL;
       if(SUCCEEDED(pDoc->QueryInterface(IID_IPersistFile,(void**)&pFile)))
       {
     LPCOLESTR     file = L"c:\\test1.htm";
     pFile->Save(file,TRUE);
       }
   }

Author

Commented:
Dan,
   I know 300 point is not enought, but how can I increase the point to 1000?

jkr,
   Ur idea may be right, but it is only a part of the solution, is it? How to get the IE instance? How to be invoked by IE? How to save the images,flashes of the web page?

Thanks for your time, but DO help me please.
jkr
CERTIFIED EXPERT
Top Expert 2012

Commented:
>>How to get the IE instance?

See http://support.microsoft.com/support/kb/articles/Q176/7/92.ASP ('HOWTO: Connect to a Running Instance of Internet Explorer')
CERTIFIED EXPERT
Author of the Year 2009

Commented:
>>but how can I increase the point to 1000?
You would have to promise that you would provide some "Points for jkr" questions upon accepting the answer.  And then let's see... 1000 points for 100 hrs work... hmmm that's approximately 10 points per hour and since each point has a rumored cash value of 1/20th of one cent... why, it certainly *would* be worth jkr's time :-)

-- Dan





Commented:
see "Building Your Own Custom Elements for Internet Explorer 5.5" at http://msdn.microsoft.com/library/default.asp?url=/nhp/Default.asp?contentid=28000441
Asta CuTechnical consultant & graphic design
CERTIFIED EXPERT
Top Expert 2004

Commented:
Please update the experts here who have so willingly stepped in to help you, since much time has passed since your last comments, and Email notifications may not have been generated to the participating experts here due to some problems at that time.  If you've been helped, accept the respective question by that expert to grade and close it.

Somewhat off-topic, but important.

****************************** ALERT********************************
WindowsUpdate - Critical Update alert March 28, 2002 from Microsoft
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/security/bulletin/ms02-015.asp
Synopsis:
Microsoft Security Bulletin MS02-015  
28 March 2002 Cumulative Patch for Internet Explorer
Originally posted: March 28, 2002
Summary
Who should read this bulletin: Customers using Microsoft® Internet Explorer
Impact of vulnerability: Two vulnerabilities, the most serious of which would allow script to run in the Local Computer Zone.
Maximum Severity Rating: Critical
Recommendation: Consumers using the affected version of IE should install the patch immediately.
Affected Software:
Microsoft Internet Explorer 5.01
Microsoft Internet Explorer 5.5
Microsoft Internet Explorer 6.0

Thought you'd appreciate knowing this.
":0)
Asta
Asta CuTechnical consultant & graphic design
CERTIFIED EXPERT
Top Expert 2004

Commented:
If you've been helped, please accept that Expert comment and convert it to the Accepted Answer to grade and close this.  If more is needed, please update this question.

Alternatively, please post a request with a zero point question in Community Support, include this URL (Question Link) in your request for a REFUND/Deletion.

Thanks,
Asta

Author

Commented:
Hi,

I am still waiting for the direct solution! I want fully functional source code that meets my request.

Thank you.
CERTIFIED EXPERT
Author of the Year 2009

Commented:
shineway,
This question is nearly ONE YEAR OLD, it is very unlikely that you will see any new comments here.  If you get a reputation of not awarding points to experts who help you, then you will find it increasingly more difficult to get more help hear at Experts Exchange.

The experts here will not write your whole program for you.  I suggest that you write as much of it as you can, and then when you run into a problem (a specific, programming problem) that you post a new question about that specific problem.

In the meantime, there is lots of good information here to get you started.  I suggest that you accept jkr's comment as an answer, and ask a new question.

-- Dan

Author

Commented:
Sorry, I can only give the 300 points to the expert whom help me to solve this prolem. You know at that time, 300 points is the highest I can offer. Maybe I should give 150 points to jkr, but not ACCEPT his comment as answer!
CERTIFIED EXPERT
Author of the Year 2009

Commented:
shineway,
That would be fine.  To do that, post a 0-pt question to Community Support and ask them to lower the points to 150 and force-accept the comment made by jkr.  To post a 0-pt question to Community Support, click here:
    http://www.experts-exchange.com/Community_Support/qAskQuestion.jsp

Be sure to mention the question ID number.  It is

      Q_20191542
CERTIFIED EXPERT

Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Answered by jkr
Please leave any comments here within the next four days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

khkremer
EE Cleanup Volunteer

Explore More ContentExplore courses, solutions, and other research materials related to this topic.