Print directly in IE without prompting user

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
 
M

Munna

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
 
S

Steven Cheng [MSFT]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top