How do I print a web page?

Started by Martin Francom, November 02, 2011, 02:59:53 PM

Previous topic - Next topic

Martin Francom

I am using Jose' WeBrowser Example program and I am trying to
add the ability to print the displayed webpage.  I am trying to use
the following code, but I get a compiler error:
   Error 533:  DISPATCH OBJECT VARIABLE EXPECTED

This code does compile with FF31-PB9  but not with FF35-PB10

what am  I doing wrong? 


    vID = 6 As Long  ' %OLECMDID_PRINT
    vOpt = 1 As Long  ' OLECMDEXECOPT_PROMPTUSER
    Object Call DISPATCH_FORM1_WEBBROWSER.ExecWB(vID, vOpt)
[\code]

José Roca

#1
Quote
what am  I doing wrong? 

Using code from an old example in a different new one.

You must use:


Local pIWebBrowser2 As IWebBrowser2
pIWebBrowser2 = OC_GetDispatch(HWND_FRMMAIN_OCXCONTROL1)
IF ISOBJECT(pIWebBrowser2) THEN
   pIWebBrowser2.ExecWB %OLECMDID_PRINT, %OLECMDEXECOPT_PROMPTUSER
   pIWebBrowser2 = NOTHING
END IF



Martin Francom

Jose,
   I thought that might be the case.
But I had no clue what I needed to do. 
Thank you for the help.