PDA

View Full Version : print withoug print dialog box


amd
11-01-2004, 06:28 AM
I am using IE and i would like to print without printing dialog box. How can i do that.

I got this code online but it is not working not sure why

==========================
<script language=JScript>
function doprint() {
document.body.insertAdjacentHTML("beforeEnd", "<object id='idWBPrint' width=0 height=0 classid='clsid:8856F961-340A-11D0-A96B-00C04FD705A2'></object>");
idWBPrint.ExecWB(6, -1);
idWBPrint.outerHTML = ""; }
</script>
===============================
===============================
==================================================
======

Here is my html code.
----------------------------------
================================
<html>

<head>
<script language=JScript>
function doprint() {
document.body.insertAdjacentHTML("beforeEnd", "<object id='idWBPrint' width=0 height=0 classid='clsid:8856F961-340A-11D0-A96B-00C04FD705A2'></object>");
idWBPrint.ExecWB(6, -1);
idWBPrint.outerHTML = ""; }
</script>
</head>

<p style="margin-top: 0; margin-bottom: 0" align="center">Print test</p>

<INPUT type="button" value="Print Page" onclick="doprint()" ;></FORM>
</body>

</html>

==================================================
========



Thanks for your time...

codegoboom
11-01-2004, 01:12 PM
I don't think that's possible from IE anymore (if it ever was); you're better off using window.print(), if anything. There is one way of printing without a prompt, when working offline, from a local file, but that's another story...