<html>
<head><title>打印</title></head>
<script>
function fn01()
{
try
{
var Wsh=new ActiveXObject("WScript.Shell");
HKEY_Key="header";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
HKEY_Key="footer";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
}
catch(e){}
document.getElementById("div1").style.display="none";
document.all.WebBrowser.ExecWB(7,1);
document.getElementById("div1").style.display="block";
}
function fn02()
{
try
{
var Wsh=new ActiveXObject("WScript.Shell");
HKEY_Key="header";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
HKEY_Key="footer";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
}
catch(e){}
document.getElementById("div1").style.display="none";
document.all.WebBrowser.ExecWB(6,1);
document.getElementById("div1").style.display="block";
}
</script>
<body>
<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0></OBJECT>
<div id="sp1">这里填写打印内容</div>
<div id="div1">
<input type=button value=打印 onclick=fn02()>
<input type=button value=页面设置 onclick=document.all.WebBrowser.ExecWB(8,1)>
<input type=button value=打印预览 onclick=fn01()>
</div>
</body>
</html>
<head><title>打印</title></head>
<script>
function fn01()
{
try
{
var Wsh=new ActiveXObject("WScript.Shell");
HKEY_Key="header";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
HKEY_Key="footer";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
}
catch(e){}
document.getElementById("div1").style.display="none";
document.all.WebBrowser.ExecWB(7,1);
document.getElementById("div1").style.display="block";
}
function fn02()
{
try
{
var Wsh=new ActiveXObject("WScript.Shell");
HKEY_Key="header";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
HKEY_Key="footer";
Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
}
catch(e){}
document.getElementById("div1").style.display="none";
document.all.WebBrowser.ExecWB(6,1);
document.getElementById("div1").style.display="block";
}
</script>
<body>
<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0></OBJECT>
<div id="sp1">这里填写打印内容</div>
<div id="div1">
<input type=button value=打印 onclick=fn02()>
<input type=button value=页面设置 onclick=document.all.WebBrowser.ExecWB(8,1)>
<input type=button value=打印预览 onclick=fn01()>
</div>
</body>
</html>
浙公网安备 33010602011771号