webbrowser组件的execwb方法
1.
2. 调用方法:
webbrowser.execwb ncmdid, ncmdexecopt, [pvain], [pvaout]
3. 参数说明:
(a).ncmdid
olecmdid_open = 1,
olecmdid_new = 2,
olecmdid_save = 3,
olecmdid_saveas = 4,
olecmdid_savecopyas = 5,
olecmdid_print = 6,
olecmdid_printpreview = 7,
olecmdid_pagesetup = 8,
olecmdid_spell = 9,
olecmdid_properties = 10,
olecmdid_cut = 11,
olecmdid_copy = 12,
olecmdid_paste = 13,
olecmdid_pastespecial = 14,
olecmdid_undo = 15,
olecmdid_redo = 16,
olecmdid_selectall = 17,
olecmdid_clearselection = 18,
olecmdid_zoom = 19,
olecmdid_getzoomrange = 20
olecmdid_updatecommands = 21
olecmdid_refresh = 22
olecmdid_stop = 23
olecmdid_hidetoolbars = 24
olecmdid_setprogressmax = 25
olecmdid_setprogresspos = 26
olecmdid_setprogresstext = 27
olecmdid_settitle = 28
olecmdid_setdownloadstate = 29
olecmdid_stopdownload = 30
上面的关键词都可以在浏览器的菜单里面找到对应的选项﹐大家一看就明白的﹗
(b).ncmdexecopt
olecmdexecopt_dodefault = 0,
olecmdexecopt_promptuser = 1,
lecmdexecopt_dontpromptuser = 2,
olecmdexecopt_showhelp = 3
对于这个参数﹐一般来说﹐选1就可以了。
4.常用:
webbrowser.execwb(1,1) 打开
webbrowser.execwb(2,1) 关闭现在所有的ie窗口,并打开一个新窗口
webbrowser.execwb(4,1) 保存网页
webbrowser.execwb(6,1) 打印
webbrowser.execwb(7,1) 打印预览
webbrowser.execwb(8,1) 打印页面设置
webbrowser.execwb(10,1) 查看页面属性
webbrowser.execwb(15,1) 好像是撤销,有待确认
webbrowser.execwb(17,1) 全选
webbrowser.execwb(22,1) 刷新
webbrowser.execwb(45,1) 关闭窗体无提示
5.示例﹕
(a)调用ie的”另存为”功能的示例﹕
(b)经过改写的登陆模式
posted on 2011-11-29 17:48
紫蝶∏飛揚↗ 阅读(1361)
评论(0) 编辑 收藏 所属分类:
div css js代码