kedarpd
asked on
Giving the focus to the webbrowser Document for printing
Hi
I want to put the focus on the webbrowser object when the form loads. Webbrowser object contans a word document. When i say print , it takes forever time. If i click on the document and then click on print it prints immediately.If i dont click on the webbrowser control and click on print it takes forever time. please advise.
The code for printing.
Private Sub mnuprint_Click()
' dislays the print dialog box and prints
WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER
Exit Sub
End Sub
This the code for printing the webbrowser contents. Any sugesstions or advise will be appreciated.
Thnkx
Kedar P Deshpande
I want to put the focus on the webbrowser object when the form loads. Webbrowser object contans a word document. When i say print , it takes forever time. If i click on the document and then click on print it prints immediately.If i dont click on the webbrowser control and click on print it takes forever time. please advise.
The code for printing.
Private Sub mnuprint_Click()
' dislays the print dialog box and prints
WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER
Exit Sub
End Sub
This the code for printing the webbrowser contents. Any sugesstions or advise will be appreciated.
Thnkx
Kedar P Deshpande
Printing on the standard printer of the system:
WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUS ER, 0, 0
WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUS
ASKER
Hi Dhaest,
Thnx for ur advise , but even this does not help. Even if i use setfocus method also it does not print.
Any oher idea abt this
Kedar
Thnx for ur advise , but even this does not help. Even if i use setfocus method also it does not print.
Any oher idea abt this
Kedar
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Dhaest,
That does help.
But i want to acheive the printing functinality at the menu click event . The code that u have given starts printing once the document is loaded. but instead i want to give the user a functinality like menu whic hhe can click and then that starts printing.
Thnx...
Kedar
That does help.
But i want to acheive the printing functinality at the menu click event . The code that u have given starts printing once the document is loaded. but instead i want to give the user a functinality like menu whic hhe can click and then that starts printing.
Thnx...
Kedar
Private Sub mnuprint_Click()
' SET THE FOCUS on the webbrowser
WebBrowser1.setfocus
' dislays the print dialog box and prints
WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER
Exit Sub
End Sub