PDA

View Full Version : why does this srcipt work on one machine and not another?


Bluemonkey
12-15-2002, 10:44 PM
why does this srcipt work on one as in it just prints the page straight out without bringing up the print diaglue but on onother machine it brings up the print box? i need it not to bring upo the print box

<html>
<head>


<script language="JavaScript">
<!--
function custom_print() {
if (document.all) {
if (navigator.appVersion.indexOf("5.0") == -1) {
var OLECMDID_PRINT = 6;
var OLECMDEXECOPT_DONTPROMPTUSER = 2;
var OLECMDEXECOPT_PROMPTUSER = 1;
var WebBrowser = "<OBJECT ID=\"WebBrowser1\" WIDTH=0 HEIGHT=0 CLASSID=\"CLSID:8856F961-340A-11D0-A96B-00C04FD705A2\"></OBJECT>";
document.body.insertAdjacentHTML("beforeEnd", WebBrowser);
WebBrowser1.ExecWB(6, 2);
WebBrowser1.outerHTML = "";
} else {
self.print();
}
} else {
self.print();
}
}
//-->
</script>
</head>
<body marginwidth="0" marginheight="0" onload="custom_print()">
kughfkgf
</body>
</html>


thanks for your help

Skyzyx
12-16-2002, 01:56 AM
self.print() is for Netscape/Gecko browsers.

The other code is for Internet Explorer. Change the 2 to a 1, like this:


WebBrowser1.ExecWB(6, 1);


This should fix your problem.

RadarBob
12-16-2002, 02:29 AM
It's psychosomatic. You need a lobotomy. I'll get a saw
lobotomies were done with an ice pick. Well, technically a surgical instrument; but it was basically an ice pick. AND the operation could be done with the patient conscious.