...

View Full Version : print preview



marshallhansen
05-31-2005, 03:44 AM
I have found this script in a ton of different discussions and everyone seems very happy with it. It is supposed to open the print preview window, however, I can't get it to do anything. Could it be because I'm on a Mac?

<script language="javascript">
function printpr(){
var OLECMDID = 7;
/* OLECMDID values:
* 6 - print
* 7 - print preview
* 8 - page setup (for printing)
* 1 - open window
* 4 - Save As
* 10 - properties
*/
var PROMPT = 2; // 1 PROMPT & 2 DONT PROMPT USER
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(OLECMDID,PROMPT);
WebBrowser1.outerHTML = "";
}
</script>


Thanks.

glenngv
05-31-2005, 05:54 AM
That only works in IE (with enabled ActiveX, I supposed).

marshallhansen
05-31-2005, 05:55 AM
Ah. Thanks.

Jerome
05-31-2005, 01:06 PM
Hi,

Look in the HTML CSS forum, make a different style-sheet for your screen and when people print, screen is horizontal, paper vertical etc, good luck



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum