<!-- 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.   

    不行啊,我就是用得这个代码,要调节INTERNET安全性才能打印啊,否则报错
      

  2.   

    SCRIPTX 只需启用一次.安装插件.
      

  3.   

    好像不行啊,如果是客户端就会提示,我用得就是INTERNET默认设置
    请问有没有Scriptx.cab文件???
      

  4.   

    print()函数,如:
    <input type="button" value="print" onclick="print()">
      

  5.   

    你可以去官方下载.
    http://www.meadroid.com/scriptx
      

  6.   

    To: meizz(梅花雪)我按照你的方法可以打印,谢谢,但是连四个按钮都打印出来了,请问如何设置可以不打印这四个按钮???谢谢。
      

  7.   

    设置可以不打印这四个按钮
    <style>
    @media print {.btn{display: none;}}
    </style><!-- IE5.5以上 -->
    <OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0></OBJECT>
    <input type=button value=打印     class=btn onclick="document.all.WebBrowser.ExecWB(6,1)">
    <input type=button value=直接打印 class=btn onclick="document.all.WebBrowser.ExecWB(6,6)">
    <input type=button value=页面设置 class=btn onclick="document.all.WebBrowser.ExecWB(8,1)">
    <input type=button value=打印预览 class=btn onclick="document.all.WebBrowser.ExecWB(7,1)">
      

  8.   

    真的很方便,謝謝   meizz(梅花雪)  謝謝 樓主