The information in this article applies to:
SYMPTOMSDevelopers wishing to print multiple copies of an HTML page from script sometimes try to host the WebBrowser control and call ExecWB() repeatedly with the OLECMDID_PRINT command and the OLECMDOPT_DONTPROMPTUSER option. However, this always brings up a print dialog box for each print request. This command works as intended in a WebBrowser host or an ActiveX control. It also works in some versions of Microsoft Internet Explorer Version 4.0. CAUSEThis was a security hole. Consider the following code:
If allowed to execute, this amounts to a Denial of Service attack, wherein it is possible to jam the user's systems by flooding them with repeat requests.
Additionally, the WebBrowser control's events cannot be sunk when the control is hosted within Internet Explorer. Therefore, there is no way of knowing when a document has completely loaded and is ready to print. For additional information, click the article number below to view the article in the Microsoft Knowledge Base: Q183048 PRB: Events Not Firing When IE4 WebBrowser Placed On Web Page RESOLUTION
There is currently no easy method for printing multiple pages programmatically from script without bringing up a dialog box. STATUSThis behavior is by design. Additional query words:
Keywords : kbPrinting kbWebBrowser kbGrpInet kbIE500 kbDSupport |
Last Reviewed: January 21, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |