By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,117 Members | 2,178 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,117 IT Pros & Developers. It's quick & easy.

Print directly in IE without prompting user

P: n/a
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

Aug 5 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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
Aug 5 '08 #2

P: n/a
"Munna" <mu******@gmail.comwrote in message
news:be**********************************@x41g2000 hsb.googlegroups.com...
but avoiding the dialog... not sure if possible ...
Not natively - all modern browsers are designed specifically to prevent this
sort of direct interfacing with client hardware and software, for fairly
obvious security reasons...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Aug 5 '08 #3

P: n/a
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:
ms****@microsoft.com.

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

--------------------
>From: =?Utf-8?B?QmlsbHkgWmhhbmc=?= <ht****@noemail.noemail>
Subject: Print directly in IE without prompting user
Date: Tue, 5 Aug 2008 03:07:04 -0700
>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

Aug 6 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.