<object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">
</object>
<OBJECT id=closes type=application/x-oleobject
classid=clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11><param name=Command value=Close></object>
<SCRIPT>
function window.onbeforeprint(){
//alert("打印前事件");
parent.iprint.style.display="none";
}
function window.onafterprint(){
//alert("打印后事件");
closes.Click();
parent.iprint.style.display="";
}
function cmdPrint()
{
document.all.WebBrowser.ExecWB(6,6);
}
function cmdPrintPreview()
{
document.all.WebBrowser.ExecWB(7,0);
}
function cmdPrintPageSetup()
{
document.all.WebBrowser.ExecWB(8,0);
}
function cmdExport()
{
document.all.WebBrowser.ExecWB(4,2,".xls");
}function test()
{
alert("hello");
}
</SCRIPT>
<html>
<head>
</head>
<title>
</title>
<body topmargin=0>
<table width=100%>
<tr>
<td width=100% align=right>
<input name=Button onClick=cmdPrintPageSetup() type=button value=页面设置>
<input name=Button onClick=cmdPrintPreview() type=button value=打印预览>
<input name=Button onClick=cmdPrint() type=button value=开始打印>
<input name=Button onClick=cmdExport() type=button value="页面另存为">
</td>
</tr>
</table>
</body>
</html>
</object>
<OBJECT id=closes type=application/x-oleobject
classid=clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11><param name=Command value=Close></object>
<SCRIPT>
function window.onbeforeprint(){
//alert("打印前事件");
parent.iprint.style.display="none";
}
function window.onafterprint(){
//alert("打印后事件");
closes.Click();
parent.iprint.style.display="";
}
function cmdPrint()
{
document.all.WebBrowser.ExecWB(6,6);
}
function cmdPrintPreview()
{
document.all.WebBrowser.ExecWB(7,0);
}
function cmdPrintPageSetup()
{
document.all.WebBrowser.ExecWB(8,0);
}
function cmdExport()
{
document.all.WebBrowser.ExecWB(4,2,".xls");
}function test()
{
alert("hello");
}
</SCRIPT>
<html>
<head>
</head>
<title>
</title>
<body topmargin=0>
<table width=100%>
<tr>
<td width=100% align=right>
<input name=Button onClick=cmdPrintPageSetup() type=button value=页面设置>
<input name=Button onClick=cmdPrintPreview() type=button value=打印预览>
<input name=Button onClick=cmdPrint() type=button value=开始打印>
<input name=Button onClick=cmdExport() type=button value="页面另存为">
</td>
</tr>
</table>
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货