在<head></head>之间加入如下代码;
<OBJECT Classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WB width=0></OBJECT>
<script language=javascript>
function doPrintSetup(){
WB.ExecWB(8,1)
}
function doPrintPreview(){
WB.ExecWB(7,1)
}
</script>
在<body>中调用:
<input type=button name=button1 value="打印设置" onclick="return doPrintSetup()">
<input type=button name=button2 value="打印预览" onclick="return doPrintPreview()">
<input type=button name=button3 value="打印本页" onclick="javascript:print()">