printing by using webbrowser control...
hai,
i am using web browser control in my application. i am dynamically generating html file and i am opening that file by using webbrowser control. Now I want to take print out that file by using web browser control. I done this in Windows Operating System by using API. the following is that API.
Shell "rundll32.exe c:\windows\system\MSHTML.dll,PrintHTML " & _
wb.LocationURL, vbNormalFocus
But it is not working in Windows-NT, even if i changed that directory to
c:\winnt\system32\MSHTML.dll....
can any body help on this...
bye
Reply For Printing Using the WebBrowser Control
Hi Pavan,
Nice meeting you.
Try the code given below. Just copy as it is.
Beaware you need a command button on the form containing Web Browser Control. Name it as cmdPrint.
Good Luck.
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
Exit Sub
End If
End If
If Err.Number <> 0 Then Exit Sub
End Sub
Regards
sushil
Re: Reply For Printing Using the WebBrowser Control
Hai thank u very much.... For that i found an alternative solution.... But any how thank you for that...