document.WebBrowser.ExecWB 报错及其解决方案


    object>
"text-align:center"> "Label1" runat="server" Text="Label">
"Label2" runat="server" Text="Label">
"Button1" onclick="document.all.WebBrowser.ExecWB(6, 1);" type="button" value="打印" /> "Button2" onclick="document.all.WebBrowser.ExecWB(6, 6);" type="button" value="直接打印" /> "Button3" onclick="document.all.WebBrowser.ExecWB(8, 1);" type="button" value="页面设置" /> "Button4" onclick="document.all.WebBrowser.ExecWB(7, 1);" type="button" value="打印预览" /> "Button5" onclick="javascript:window.close()" type="button" value="关闭窗口" />
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

document.WebBrowser.ExecWB 报错及其解决方案_第1张图片
原因是:IE设置了安全级别需启用没有标记为安全的ActiveX控件
解决方案:IE浏览器-工具菜单选项——Internet选项——安全——Internet——自定义级别——启用没有标记为安全的ActiveX控件
document.WebBrowser.ExecWB 报错及其解决方案_第2张图片
document.WebBrowser.ExecWB 报错及其解决方案_第3张图片
运行程序,问题就可以解决了
document.WebBrowser.ExecWB 报错及其解决方案_第4张图片

        
            

你可能感兴趣的:(打印)