Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
1.67/5 (3 votes)
See more:
How can I print a report without prompting for Print Dialog Box ?
Is there any way to bypass the Print Dialog Box ?

Thanks for your Help.



User has not specified, the platform. Whether it is Win Forms or ASP.Net Page
Posted
Updated 18-Oct-10 5:21am
v2
Comments
Toli Cuturicu 12-Oct-10 3:26am    
If you want to do it, then do it. Nobody is stopping you. You have my blessing.
If you face any issues, tell us where exactly are you stuck. We will help you then.
codeprojectkrish 22-May-14 3:45am    
still my question is how I can bifurcate the dialog box box I need to print 100's of form in a printer..
Bikash Shrestha From Nepal 12-Oct-10 3:34am    
Good suggestion Toli Bro
Sandeep Mewara 12-Oct-10 3:44am    
So what effort have you made? Whats stopping you? Issue?
Abhinav S 18-Oct-10 11:21am    
What have you tried so far?

Are you using ASP.Net or WinForms ?

If you want the solution for ASP.Net, then try following links. (It only works in Internet Explorer)

On MSDN[^]

On Devx[^]
 
Share this answer
 
XML
<script language="vbscript">
Sub Print()
       OLECMDID_PRINT = 6
       OLECMDEXECOPT_DONTPROMPTUSER = 2
       OLECMDEXECOPT_PROMPTUSER = 1
       call WB.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER,1)
End Sub
document.write "<object ID='WB' WIDTH=0 HEIGHT=0 CLASSID='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2'></object>"
</script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
    <a href="javascript:window.print();">Print</a> </div>
    </form>
</body>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900