具体是将被浏览的页面打印出来.我的应用场景是从数据库里读出了数据,显示在一个弹出窗口中,现在要实现的功能就是将这个弹出的窗口页面或者是其内容通过打印机打印出来。

解决方案 »

  1.   

    <OBJECT id="WebBrowser" height="0" width="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" VIEWASTEXT>
    </OBJECT>
    <input class="Noprint" style="margin-left:3px" type="button" name="print" value="打印" onclick="func_print()"><SCRIPT LANGUAGE="JavaScript">
    <!--
    function func_print()//直接打印
    {
    document.all.WebBrowser.ExecWB(6,6);
    }function func_show()//预览打印
    {
    document.all.WebBrowser.ExecWB(7,1);
    }
    //-->
    </SCRIPT>
      

  2.   

    <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(7,1) 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=关闭>学习了,第一次见到这个东西.谢谢楼上的.
      

  3.   

    打印问题选用了java,按钮问题用javascript解决了,预览用的<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT> 才发现大虾们的解答,不过还是谢谢大家!<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT> 
    这个东东是做什么的,这么强????