Hi!<br><br>I used VB web browser control to browse through Internet and download the page. But I don't know how to print the page. I want to make my Print function as IE5 Print function. How can I do that?<br><br>Thank you very much!
This piece of code opens the IE print dialog to print the currently viewed webpage in a Web Browser. Please note, you must change the 2 pieces of red code to the name of your Web Browser.
Dim eQuery As OLECMDF 'return value type for QueryStatusWB
On Error Resume Next
eQuery = WebBrowserName.QueryStatusWB(OLECMDID_PRINT) 'get print command status
If Err.Number = 0 Then
If eQuery And OLECMDF_ENABLED Then WebBrowserName.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER, "", "" 'Ok to Print?
Else
MsgBox "The Print command is currently disabled."
End If
End If
If Err.Number <> 0 Then MsgBox "Print command Error: " & Err.Description
On Error GoTo 0
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.