How To Print the WebBrowser Control (176400)
The information in this article applies to:
- Microsoft Visual Basic Control Creation Edition for Windows 5.0
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Standard Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Professional Edition, 32-bit, for Windows 4.0
- Microsoft Visual Basic Enterprise Edition, 32-bit, for Windows 4.0
This article was previously published under Q176400 SUMMARY
Microsoft Internet Explorer 3.0 includes a custom ActiveX control called
WebBrowser. The WebBrowser control does not include a Print method that can
be directly called from Visual Basic. Tto print the contents of the
WebBrowser Control in Visual Basic, you must set the focus to the content
portion of the control and a CTRL-P keystroke sequence must be sent to the
control.
The difficulty with this is that the WebBrowser window is actually made up
of more than one window. The window that needs to have the focus to print
is the one with a class name of "HTML_Internet Explorer," and the SetFocus
method sets the focus to the "SHELL DocObject View" window. Before sending
a CTRL-P keystroke sequence to the WebBrowser control, the proper child
window of the control must have the focus.
REFERENCES
For additional information, please see the following articles in the
Microsoft Knowledge Base:
162719 How To Use the WebBrowser Control from Visual Basic 5.0
155969 How To Distribute the WebBrowser Control
Modification Type: | Minor | Last Reviewed: | 7/15/2004 |
---|
Keywords: | kb32bitOnly kbhowto KB176400 |
---|
|