网页WB.ExecWB控件打印方法 <table width="100%" cellpadding="1" onmouseover="kpr.style.display='';" > <tr> <td width="100%" height="25" colspan="3"><script language="javascript"> function printsetup(){ // 打印页面设置 wb.execwb(8,1); } function printpreview(){ // 打印页面预览 wb.execwb(7,1); } function printit() { if (confirm('确定打印吗?')){ wb.execwb(6,6) } } </script> <OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 id=wb name=wb width=3></OBJECT> <div id="kpr"> <input class="ipt" type=button name= button _print value="打印" onclick ="kpr.style.display='none';javascript :printit();"> <input class="ipt" type=button name=button _setup value="打印页面设置" onclick =" javascript : printsetup();"> <input class="ipt" type=button name=button_show value="打印预览" onclick="kpr.style.display='none';javascript:printpreview();"> <input class="ipt" type=button name= button _fh value="关闭" onclick =" javascript:window.close();"> </td> </div> </tr> </table>
<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT> <input name=Button onClick=document.all.WebBrowser.ExecWB(1,1) type=button value=打开> <input name=Button onClick=document.all.WebBrowser.ExecWB(2,1) type=button value=关闭所有> <input name=Button onClick=document.all.WebBrowser.ExecWB(4,1) type=button value=另存为> <input name=Button onClick=document.all.WebBrowser.ExecWB(6,1) type=button value=打印> <input name=Button onClick=document.all.WebBrowser.ExecWB(6,6) type=button value=直接打印> <input name=Button onClick=document.all.WebBrowser.ExecWB(8,1) type=button value=页面设置> <input name=Button onClick=document.all.WebBrowser.ExecWB(10,1) type=button value=属性> <input name=Button onClick=document.all.WebBrowser.ExecWB(17,1) type=button value=全选> <input name=Button onClick=document.all.WebBrowser.ExecWB(22,1) type=button value=刷新> <input name=Button onClick=document.all.WebBrowser.ExecWB(45,1) type=button value=关闭> |