在你调用这些IE命令,先要在页面里加上一个OBJECT,(这个OBJECT要在HTML格式下,不能直接放在ASPX页面里),然后才能让你调用上面的命令。

解决方案 »

  1.   

    <OBJECT id="WebBrowser1" height="0" width="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"
    VIEWASTEXT>
    </OBJECT>
    <center class="Noprint">
    <input name="print" type="button" id="print" onclick="document.all.WebBrowser1.ExecWB(6,1)"
    value="打印">&nbsp; <input name="setpage" type="button" id="setpage" onclick="document.all.WebBrowser1.ExecWB(8,1)"
    value="页面设置"> &nbsp; <input name="pageview" type="button" id="pageview" onclick="document.all.WebBrowser1.ExecWB(7,1)"
    value="打印预览">
    </center>