IE6.0 没有问题.
<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">
</OBJECT>
<script language=JavaScript>
document.WB.ExecWB(6,1);
</script>

解决方案 »

  1.   

    <html>
    <head>
    <title>查询结果…</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <STYLE TYPE="text/css">
    @media print{                           <!--控制哪些打印,哪些不打印的样式-->   
    .print {display:block;}
    .notPrint {display:none;}
    }
    </STYLE>
    </head>
    <body><table border="1" width="58%" align="center" height="55">
      <tr> 
        <td width="21%" align="center"> 
           Item1
        </td>
        <td width="21%" align="center"> 
           Item2
        </td>
      </tr>
    </table><!--在不要打印的内容用<span class="notprint">...</span>圈起来-->
    <span class="notprint">                        
    <table border="1" width="58%" align="center" height="55">
      <tr> 
        <td width="21%" align="center"> 
           Item3,not print
        </td>
        <td width="21%" align="center"> 
           Item4,not print
        </td>
      </tr>
    </table>
    </span><object id="WebBrowser1" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"> </object> <span class="notprint"> 
            <input type=button name=print value="打印" onClick="WebBrowser1.ExecWB(6,1)">
    </span> 
    <span class="notprint"> 
            <input type=button name=print2 value="打印预览" onClick="WebBrowser1.ExecWB(7,1)">
    </span> 
    </body>
    </html>
      

  2.   

    如果这个窗口是showmodeldialog打开的,就会发生异常