473,395 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Print directly in IE without prompting user

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
3 3267
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
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: yfng | last post by:
I am doing a web project. Is there any method to print web pages with support of page breaks and without printer prompt diaglog e.g.like window.print() (or close immediately) by just clicking a...
6
by: Dennis Allen | last post by:
Hi. On one particular web page I want to offer the user a print button. Question. How do I create one? Something compatible with most browsers would be nice. Appreciate any advice...Dennis
2
by: Yuriy | last post by:
Hello! I need to print PDF Document by clicking a button on .aspx page. The PDF should be printed on client printer without displaing it on the window. I tried Process namespace but it doesn't...
4
by: rom | last post by:
I need to print a html table when the user clicks on a key. the problem is that i don't want the printer dialog box to appear. i guess this is impossible in javascript so i think to create an...
7
by: mattmerc | last post by:
Hi all, We have all seen lot of method for exporting datagrids to Excel. I have a slightly different need. I think it should be easy to accomplish but I am not sure how. I would like when a user...
1
by: Alba López | last post by:
Hi, I want to print a webform directly to the default printer, without showing the user the print dialog box. I used to do it with window.open and it worked as I wanted to, but after installing...
1
by: Sam | last post by:
Hi All I have a web page that contains a datagrid and in this data grid, I have a checkbox column template which allow user to select one or more applicant's loan applicantion to print....
4
by: Jamey Shuemaker | last post by:
A2k2 with user-level security and all preventive measures, vis a vis, Security FAQ enabled or enacted. I've got three DBs, which due to size constraints can't, or rather, probably shouldn't be...
7
by: pamela fluente | last post by:
hi, What is the cleanest and effective way to use the PrintDocument object to print directly to a pdf file "myfile.pdf" (with no prompt to the user: just print to file and make pdf) ? Does...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.