<input type=button value=打印     onclick="window.print()">
<INPUT type=button value=打印     onclick="document.execCommand('Print')">
<!-- IE5.5以上 -->
<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0></OBJECT>
<input type=button value=打印     onclick=document.all.WebBrowser.ExecWB(6,1)>
<input type=button value=直接打印 onclick=document.all.WebBrowser.ExecWB(6,6)>
<input type=button value=页面设置 onclick=document.all.WebBrowser.ExecWB(8,1)>
<input type=button value=打印预览 onclick=document.all.WebBrowser.ExecWB(7,1)>

解决方案 »

  1.   

    想请问一下,那里有比较全面的介绍object控件的资料
    ,谢谢了
      

  2.   

    2楼的代码,我怎么运行不了,点击“打印预览”按钮,就会报错“不支持该命令”,调试说是“onclick=document.all.WebBrowser.ExecWB(7,1)”错误,请高手指教
      

  3.   

    我也试过,不能运行。
    提示:document.all.WebBrowser为空或不是对象!
    是不是还需要什么控件啊?
    关注中……
      

  4.   

    document.all.WebBrowser.ExecWB(6,1)方法只支持IE5.5以上的版本,对与用户来说还不现实,因为用户大多使用IE5.0