Saving a Web Page

tgosling
10-09-2001, 09:30 AM
Anyone know how to automate ie5.5 to save a web page?

Just playing around I've tried

ie.ExecWB OLECMDID_SAVEAS, OLECMDEXECOPT_DONTPROMPTUSER, "C:\page2"

where ie is my internet explorer application object.
This works fine and saves the current web page but it prompts the user with a 'save as' dialog box.

Ignoring DONTPROMPTUSER is a new feature in versions of IE later than version 4. Is there any way to get around this so that when someone clicks the save button on my form it allocates a new filename and just saves the page without any additional user input?

Tim.

Ad1
10-09-2001, 09:55 AM
you can't bypass the user with that method, but you can stick the html of the page into a string and then save the string
<pre>strHTML= "{HTML}" & WebBrowser1.Document.All.Item(0).innerHTML & "{/HTML}"</pre>
p.s. replace the curly braces with normal html tags, had to do it like this so it would show on the page

ChiefRedBull
10-09-2001, 10:48 AM
Well you can do it manually, downloading the HTML, searching it and downloading all the images, extretnal refernces etc.... then seraching the HTML again - and replacing all the filepaths to local relative ones.
Tedious - but I wrote an app that works fine.

Chief

"How are we to learn, if those that know will not teach... ?" - Me.

Volte
10-09-2001, 10:54 AM
if you use an Inet control, I think <pre>strHTML = Inet1.OpenURL("www.urlhere.com")</pre> will load the HTML into a string.

If at first, you don't succed, call it version 1.0.

ChiefRedBull
10-09-2001, 10:58 AM
<pre><font color=red>Inet.Execute (imagePath)</font color=red>

</pre>I believe will downlaod images.

Chief

"How are we to learn, if those that know will not teach... ?" - Me.

tgosling
10-10-2001, 04:35 AM
Thanks to both of you for your ideas and all I can say is Wow what a hastle to acheive such a simple thing!

I've found an article at:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnie55/html/wb_print.asp

which has some ideas on how to get around a similar problem with the print dialog. Before I try the convert to text, download images and alter html method I think I'll have a go at intercepting and controlling the dialog window.

I'll let you know if I have any luck with this.

Tim.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum