Click here to Skip to main content
15,910,878 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using Ie 7 as browser and using window.print() method to print.it is working well.what i want is to skip the printer's dialog box

Well there might be some dll file of windows that could skip this i was using javascript code
C#
var sURL = document.location.href;
var WshShell = new ActiveXObject("wscript.shell");
WshShell.run("rundll32.exe c:\windows\system32\mshtml.dll, PrintHTML " + sURL);

But it is not working as well

Now i am using the following function and i am having following scenario.it is printing but not skiping the print dialog

C#
function printPartOfPage(elementId)
        {
         var printContent = document.getElementById(elementId);
         var windowUrl = 'about:blank';
         var uniqueName = new Date();
         var windowName = 'Print' + uniqueName.getTime();
         var printWindow = window.open(windowUrl, windowName, 'left=50000,top=50000,width=0,height=0');
         printWindow.document.write(printContent.innerHTML);
         //var sURL = document.location.href;
         //var WshShell = new ActiveXObject("wscript.shell");
         //WshShell.run("rundll32.exe c:\windows\system32\mshtml.dll, PrintHTML " + windowUrl);
         printWindow.document.close();
         printWindow.focus();
         printWindow.print();
         printWindow.close();
}
Posted
Updated 27-Apr-10 0:44am
v3

1 solution

You can't. you simply don't have that level of control.
 
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