Print directly in IE without prompting user

  • Thread starter Thread starter Billy Zhang
  • Start date Start date
B

Billy Zhang

I have a asp.net page, it uses js to print in IE.
It always has the prompting user window appear.

I have tried:

<input onclick="document.all.WebBrowser.ExecWB(6,6)" type="button"
value="Print directly">

<input onclick="document.all.WebBrowser.ExecWB(6,2)" type="button"
value="Print directly">

All didn't work.


For example:
http://topic.csdn.net/t/20060509/01/4737530.html
http://blog.chinaunix.net/u1/51862/showart_435050.html
http://msdn.microsoft.com/en-us/library/ms683930.aspx

OLECMDEXECOPT_DONTPROMPTUSER = 2,

How to avoid this prompt window?

Thanks,
-Billy
 
Hi

All you can do is to build a separate printer friendly page and onload
use window.print to popup the print dialog...
but avoiding the dialog... not sure if possible ...

regards

Munna
 
Hi Billy,

As for printing in web page via client script, it is quite restricted due
to browser's security model, it won't allow silent print via script.
Generally, we only have the "window.print()" function to let user
interactively print the current active document in the browser. For those
cases that we need more control over the printing in webpage, we may
consider some rich client approach such as ActiveX control(require the
client-side to allow running of the activex).

Sincerely,

Steven Cheng
Microsoft MSDN Online Support Lead

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top