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?
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).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.