Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

save a Web page without user intervention

Status
Not open for further replies.

mnayd

Programmer
Oct 23, 2003
5
0
0
FR
Hi

I try to save a Web page without user interface. I use a IHTMLDocument2. I call
execCommand "SaveAs", False, ”file_name”
but the command displays a dialogue box anyway.
How can I save the page with no user intervention?
 
Hi Files save as is not the way to go.

If you use the Inet OCX control. (Internet control) you can use a simple grab/put solution.

Dim strURL As String ' URL string
Dim intFile As Integer ' FreeFile variable
Dim FileLocation as string ' where to save the file

intFile = FreeFile()
strURL = "http:\\where the page is & filename"

' Create the new file in the target directory
Open FileLocation For Output As #intFile
Write #intFile, Inet1.OpenURL(strURL) ' write the
'downloading data to the file
Close #intFile

Dress up the procedure with what ever and it should work for you.
 
go to google, type in edanmo vb. he has two different topics, one for saving the HTML doc as an IPersistFile and another that saves the file as a (.mht) file (web file complete with resources embeded in it).
 
Go to thread222-672384 in this forum. I had the same problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top