-
I have tried:
Code:
Printer.print WebBrowser1.Document
but this simply printed the word "[object]" on the page.
I cant seem to find any reference to printing in the webbrowser section of the MSDN library CD.
$1,000,000 to the person* that solves this!
* Martian Dollars, MD$1 = $0.00000001 :o
Hehehe thanks!
-
Use the SendKeys statement:
Code:
WebBrowser1.SetFocus
SendKeys "^p", True
Good luck!
PS. You can keep your money!
-
This is the code i use.
Code:
Private Sub cmdPrint_Click()
Dim eQuery As OLECMDF
On Error Resume Next
eQuery = WebBrowser1.QueryStatusWB(OLECMDID_PRINT)
If Err.Number = 0 Then
If eQuery And OLECMDF_ENABLED Then
WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER, "", ""
Else
MsgBox "The Print command is currently disabled."
End If
End If
If Err.Number <> 0 Then MsgBox "Print command Error: " & Err.Description
End Sub