Saving HTML page from WebBrowser 
Author Message
 Saving HTML page from WebBrowser

I would like to save a HTML page currently displayed in the WebBrowser
control into a file. Can anybody give me a hint?

Thanks
Jiri



Sun, 10 Jun 2001 03:00:00 GMT  
 Saving HTML page from WebBrowser
Private Sub mnuFSave_Click()
   Dim eQuery As OLECMDF
   On Error Resume Next
   eQuery = brwWebBrowser.QueryStatusWB(OLECMDID_SAVEAS)
   If Err.Number = 0 Then
      If eQuery And OLECMDF_ENABLED Then
         brwWebBrowser.ExecWB OLECMDID_SAVEAS, OLECMDEXECOPT_DODEFAULT
      Else
         MsgBox "The Save command is currently disabled."
      End If
   End If
   If Err.Number = 0 Then
      '
   Else
      MsgBox "Save command Error: " & Err.Description, vbExclamation, "Error
" & Err.Number
   End If
End Sub

Regards,
            <EHi>


Quote:
>I would like to save a HTML page currently displayed in the WebBrowser
>control into a file. Can anybody give me a hint?

>Thanks
>Jiri




Sun, 10 Jun 2001 03:00:00 GMT  
 Saving HTML page from WebBrowser
Do you want to do this programmatically; that is, without user intervention?

I have searched and enquired extensively but in vain for an explanation of
those elusive optional parameters in the "ExecWB" Method. There is very
little documentation on this subject in MSDN, even for the C devotees.

I have concluded that it is one of those situations where functionality is
simply not available to us through the VB interface; one of those "the
architecture of the language" explanations, no doubt. I suspect that the
"pvaIn" parameter for OLECMDID_SAVEAS  requires a "pidl" (pointer to an
ITEMIDLIST) which to the best of my knowledge can be used but not
constructed in VB. My compromise is to write the BODY of the HTML document
to a file:

    "<HTML>" &...body.outerHTML & "</HTML>"

Of course, HTML pages tend to be so so "dynamic" now that simply saving the
HTML often isn't terribly useful; without images, scripts, etc.

I don't know much about the "Internet Transfer Control" (MSInet.ocx). There
are some tricky parameters relating to connections/proxies/timing etc, but I
understand that statements like

    S = Inet1.OpenURL("http://...etc")

are possible, then the save from string S would be a breeze. Have you
explored this option?

Hope this helps in some way.

Barry Evans
Canberra, Australia
----------------------------

I would like to save a HTML page currently displayed in the WebBrowser
control into a file. Can anybody give me a hint?

Thanks
Jiri



Mon, 11 Jun 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Save current html page as html file

2. How to SAVE html document, retrieved with WebBrowser component

3. Saving HTML files with webBrowser

4. Automatically save html in webbrowser control

5. save HTML document from webbrowser

6. WebBrowser Save HTML Source ?

7. Can't print saved html in webbrowser control

8. Change Font and Save WebBrowser Control Html

9. saving html files with webBrowser

10. Printing an HTML page displayed in a WebBrowser control

11. WebBrowser - Extracting the HTML of a page

12. Is there any way I can have the WebBrowser control display the HTML page with ou

 

 
Powered by phpBB® Forum Software