WebBrowser control for Printing in IE

Results 1 to 2 of 2

Thread: WebBrowser control for Printing in IE

  1. #1
    Diwakar Guest

    Default WebBrowser control for Printing in IE

    Has anyone used a WebRowser control. I&#039m trying to use it to print a modal window using the following script, buts its giving me an unknown exception<BR><BR>&#060;script LANGUAGE="VBScript"&#062;<BR> const OLECMDID_PRINT = 6<BR> const OLECMDEXECOPT_DONTPROMPTUSER = 2<BR> const OLECMDEXECOPT_PROMPTUSER = 1 <BR><BR> WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, "",""<BR> window.close()<BR><BR>&#060;/script&#062;<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: WebBrowser control for Printing in IE

    I don&#039t know if this will help, but this is how I print:<BR><BR>There are a couple of ways to invoke the print dialog depending on the browser and browser version you are using. In IE5 and Netscape 4+ you can use the print() command. Here are a couple of examples:<BR><BR>&#060;a href="javascript:window.self.print();"&#062;Print& #060;/a&#062;<BR><BR>We could also use this.print() rather than window.self.<BR><BR>Button example:<BR><BR>&#060;form&#062;<BR>&#060;input type=button name=print value="Print" onClick="javascript:window.print()"&#062;<BR>&#060 ;/form&#062;<BR><BR>Unfortunately, these commands will not work in IE4. However, Microsoft has provided code that will give IE4 the same functionality. You can download this code and read the article "Scripting Support for Web Page Printing" at http://msdn.microsoft.com/workshop/author/script/dhtmlprint.asp

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts