Saving Pages Using the WebBrowser Control ??? 
Author Message
 Saving Pages Using the WebBrowser Control ???

Hello Darin,

Until some better documentation comes out, I think you're sunk.  The key
must be that for the Print command (and refresh and update controls) you
don't have to pass valid values for the final two parameters of the ExecWB
method.  Until these parameters are documented, and we know what the
OLECMDID_SAVE command wants passed in those "pvain" and "pvaout" parameters,
there's nothing we can do to make those commands work.

Have you checked in the Internet Client SDK?  The answer might be in there.
I hope this helps,

--

Larry Tubbs, MCPS, MCSD
Silverleaf Vacation Club

http://www.*-*-*.com/


Quote:
>I've been trying to develop a simple VB5 app that will hook into a running
>Internet Explorer 4 application. I've included the WebBrowser
>(InternetExplorer) control in my project and this has allowed me access to
>IE4. The main goal of my simple VB app is to save Web pages in the same
>manner that one can do currently using the "Save" option under "File" in
>IE4.

<some deleted>


Sun, 30 Jan 2000 03:00:00 GMT  
 Saving Pages Using the WebBrowser Control ???

I've been trying to develop a simple VB5 app that will hook into a running
Internet Explorer 4 application. I've included the WebBrowser
(InternetExplorer) control in my project and this has allowed me access to
IE4. The main goal of my simple VB app is to save Web pages in the same
manner that one can do currently using the "Save" option under "File" in
IE4.

What I would like to know how to do is "Save" the current page displayed in
IE4, so I'm guessing that I would have to use the IE4 "Save" or "SaveAs"
hooks available in the WebBrowser control.

I've recently read an article from the MS Knowledge Base concerning a
similar technique pertaining to the "Print" IE4 option. I incorporated the
code from this article into my app and printing now works great. However,
I'm trying to adapt that procedure to perform "Save", but I've been
unsuccessful. I don't know what the deal is.

Here's what the "Print" code looks like:

' m_iehook is a WebBrowser object (defined elsewhere)

    Dim myOleCmdId As OLECMDID

    myOldCmdId = OLECMDID_PRINT

        eQuery = m_iehook.QueryStatusWB(myOleCmdId)
        If Err.Number = 0 Then
            If eQuery And OLECMDF_ENABLED Then
                m_iehook.ExecWB myOleCmdId, OLECMDEXECOPT_PROMPTUSER, "", ""
            Else
                MsgBox "eQuery Error: " & Err.Description
            End If
        End If

        If Err.Number <> 0 Then
            MsgBox "Command Error: " & Err.Description
        End If

Of course there is a whole mess of OLECMDID constants defined in the
WebBrowser control that I would expect to behave the same way as print.
However, the only ones that I can get to work without error are:

OLECMDID_PRINT
OLECMDID_REFRESH
OLECMDID_UPDATECOMMANDS

What I'd really like is obviously OLECMDID_SAVE, but when I try this method,
'eQuery And OLECMDF_ENABLED' returns 'False' and fails. If I try to force
the ExecWB, I get "Method of 'ExecWB' of object 'IWebBrowser2' failed".

I don't understand why the QueryStatusWB() is not giving me OLECMDF_ENABLED
for OLECMDID_SAVE. I guess that I'm not completely sure even what I'm asking
with QueryStatusWB().

Any thoughts, ideas, or solutions would be greatly appreciated!

Darin Boesch



Sun, 30 Jan 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Saving Pages Using the WebBrowser Control ???

2. Saving web pages to file using webBrowser or inet control

3. Saving web page with images using the WebBrowser control

4. Saving web pages with WebBrowser control

5. Saving a complete Web Page from the WebBrowser control

6. Webbrowser control - Saving a web page

7. new problem of webbrowser control save web page

8. webbrowser control save web page

9. Using Webbrower control to save a page

10. WebBrowser Ctl: save web page to local machine

11. Save WebBrowser's web page

12. Saving HTML page from WebBrowser

 

 
Powered by phpBB® Forum Software