(按钮的使用)
<object id="WebBrowser" width=10 height=10 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>
<input type="button" name="Button" value="打印预览" onClick="document.all.WebBrowser.ExecWB(7,1)">
<input type="button" name="Button" value="打印设置" onClick="document.all.WebBrowser.ExecWB(8,1)">
<a href=" javascript:window.print()">[打印线路 ] </a>
或
<input type="button" name="mPrint" value="打印" onclick="exePrint();">
<input type="button" name="mPreview" value="打印预览" onclick="exePreview();">
<input type="button" name="mSetting" value="打印设置" onclick="exeSetting();">
<object ID="WebBrowser" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B- 00C04FD705A2"></object>
<script language="javascript">
function exePrint()
{
document.all.WebBrowser.ExecWB(6,1);
//liu= window.open("b.asp?do=1","_blank","left=2000,top=2000,fullscreen=3");
}
function exePreview()
{
//window.open("b.asp?do=2","_blank","left=2000,top=2000,fullscreen=3");
document.all.WebBrowser.ExecWB(7,1);
}
function exeSetting()
{
WebBrowser.ExecWB(8,1);
}
</script>
加上一个打印时隐藏按钮的样式:<style> @media print{ INPUT {display:none} } </style>