WebBrowser

WebBrowser.ExecWB(1,1) 打开
Web.ExecWB(2,1) 关闭现在所有的IE窗口,并打开一个新窗口
Web.ExecWB(4,1) 保存网页
Web.ExecWB(6,1) 打印
Web.ExecWB(7,1) 打印预览
Web.ExecWB(8,1) 打印页面设置
Web.ExecWB(10,1) 查看页面属性
Web.ExecWB(15,1) 好像是撤销,有待确认
Web.ExecWB(17,1) 全选
Web.ExecWB(22,1) 刷新
Web.ExecWB(45,1) 关闭窗体无提示 

Example:

<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0 VIEWASTEXT> </OBJECT>
<input type=button value=打印 οnclick="document.all.WebBrowser.ExecWB(6,1)" class="NOPRINT">
<input type=button value=直接打印 οnclick="document.all.WebBrowser.ExecWB(6,6)" class="NOPRINT">
<input type=button value=页面设置 οnclick="document.all.WebBrowser.ExecWB(8,1)" class="NOPRINT">
<input type=button value=打印预览 οnclick="document.all.WebBrowser.ExecWB(7,1)" class="NOPRINT">


扩展:
<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 id=WebBrowser width=0></OBJECT>

<table><tr><td>

<input name=Button onClick=document.all.WebBrowser.ExecWB(1,1) type=button value=打开>

</td></tr>



<tr><td><input name=Button onClick=document.all.WebBrowser.ExecWB(4,1) type=button value=另存为></td></tr>

<tr><td><input name=Button onClick=document.all.WebBrowser.ExecWB(10,1) type=button value=属性></td></tr>

<tr><td><input name=Button onClick=document.all.WebBrowser.ExecWB(6,1) type=button value=打印></td></tr>

<tr><td><input name=Button onClick=document.all.WebBrowser.ExecWB(6,6) type=button value=打印>不会弹出打印机窗口</td></tr>

<tr><td><input name=Button onClick=document.all.WebBrowser.ExecWB(7,1) type=button value=打印预览 ></td></tr>

<tr><td><input name=Button onClick=document.all.WebBrowser.ExecWB(8,1) type=button value=页面设置></td></tr>

<tr><td><input name=Button onClick=document.all.WebBrowser.ExecWB(10,1) type=button value=查看页面属性></td></tr>

<tr><td><input name=Button onClick=document.all.WebBrowser.ExecWB(15,1) type=button value=撤销></td></tr>

<tr><td><input name=Button onClick=document.all.WebBrowser.ExecWB(17,1) type=button value=全选></td></tr>

<tr><td><input name=Button onClick=document.all.WebBrowser.ExecWB(22,1) type=button value=刷新></td></tr>

<tr><td><input name=Button onClick=document.all.WebBrowser.ExecWB(45,1) type=button value=关闭窗体无提示></td></tr>

<tr><td><input type=button value=刷新 name=refresh οnclick="window.location.reload()">

</td></tr>

<tr><td></td></tr>

<tr><td><input type="button" name="Button" value="导入收藏夹" onClick=window.external.ImportExportFavorites(true,'');></td></tr>

<tr><td><input type="button" name="Button3" value="导出收藏夹" onClick=window.external.ImportExportFavorites(false,'');></td></tr>

<tr><td><INPUT name=Button2 οnclick="window.external.AddFavorite(location.href, document.title)" type=button value=加入收藏夹></td></tr>

<tr><td><INPUT name=Submit2 οnclick="window.external.ShowBrowserUI('OrganizeFavorites', null)" type=button value=整理收藏夹></td></tr>

<tr><td><INPUT name=Button οnclick='window.location = "view-source:" + window.location.href' type=button value=查看源文件></td></tr>



<tr><td><INPUT name=Button οnclick="window.external.ShowBrowserUI('LanguageDialog', null)" type=button value=语言设置></td></tr>

<tr><td><INPUT name=Submit οnclick=history.go(1) type=submit value=前进></td></tr>

<tr><td><INPUT name=Submit2 οnclick=history.go(-1) type=submit value=后退></td></tr>

<tr><td><input type=button value=加入到频道 οnclick="window.external.addChannel('../../www.meizz.com/default.htm') ">

</td></tr>
IE下页面打印控件 类似于ScriptX控件,但本控件可免费使用 控件使用OCX技术,使控件加载到IE浏览器中 首次使用需要用户加载Activex控件,以后将自动加载运行 控件功能: 1.屏蔽IE打印时出现的打印设置框。 2.自动设置各打印控制参数。 3.实现自动打印。 使用方法 控件的ID为clsid:AE1A309B-6FFA-4FCF-B07F-CB97FFD56B1B 使用Object标签包裹即可。 如 <OBJECT ID="TestAX" classid="clsid:AE1A309B-6FFA-4FCF-B07F-CB97FFD56B1B" codebase="IEprint.ocx#version=" width=0 height=0 align=center hspace=0 vspace=0 ></OBJECT> 使用Javascript或VBScript程序进行调用 使用使,先得到打印控件Object对象实例如 a=document.getElementById("TestAX"); 参数内容 接着对a进行操作即可 a.Mar_left=0.0075; //左边界 a.Mar_Top=0.0075; //上边界 a.Mar_Right=0.0075; //右边界 a.Mar_Bottom=0.0075; //下边界 a.Orientation="纵向";//打印方向 a.Paper_Size="Folio"; //纸张大小 a.Header_Html="Headeraaaaaaaa"; //头部标注 a.Footer_Html="Footerssssssss"; //尾部标注 a.ApplySetup(); //应用上面的设置 函数方法 a.PrintWithOutSetup(); //无需设置即打印内容 a.PrintWithOutSetupPrintWithOutByID("cnnb"); //打印除ID为cnnb的其他内容。即过滤id为cnnb的所有内容 a.PrintWithOutSetupPrintByID("163");//打印id为163的内容。即过滤id为163以外的所有内容 a.PrintWithSetup(); //有设置选项的打印 a.PrintPreView();//打印预览 对本控件有建议的可以联系我,一般隐身存在。。。 chatop QQ948905
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值