The complete WebBrowser.ExecWB

Recommended for you: Get network issues from WhatsUp Gold. Not end users.
<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT> 
<input name=Button .Click=document.all.WebBrowser.ExecWB(1,1) Type=button value= open>
<input name=Button .Click=document.all.WebBrowser.ExecWB(2,1) Type=button value= to close all>
<input name=Button .Click=document.all.WebBrowser.ExecWB(4,1) Type=button value= save as> 
<input name=Button .Click=document.all.WebBrowser.ExecWB(6,1) Type=button value= print>
<input name=Button .Click=document.all.WebBrowser.ExecWB(6,6) Type=button value= direct printing>
<input name=Button .Click=document.all.WebBrowser.ExecWB(7,1) Type=button value= Print Preview>
<input name=Button .Click=document.all.WebBrowser.ExecWB(8,1) Type=button value= page setup>
<input name=Button .Click=document.all.WebBrowser.ExecWB(10,1) Type=button the value= attribute>
<input name=Button .Click=document.all.WebBrowser.ExecWB(17,1) Select type=button value=>
<input name=Button .Click=document.all.WebBrowser.ExecWB(22,1) Type=button value= refresh>
<input name=Button .Click=document.all.WebBrowser.ExecWB(45,1) Type=button value= close>
The execWB method of WebBrowser component

1. <object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>

The 2 method calls:
WebBrowser.ExecWB nCmdID, nCmdExecOpt, [pvaIn], [pvaOut]

3 parameters:
(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
The above keywords can be found in the corresponding option in the browser menu, you can understand it﹗
(b).nCmdExecOpt
OLECMDEXECOPT_DODEFAULT = 0,
OLECMDEXECOPT_PROMPTUSER = 1,
LECMDEXECOPT_DONTPROMPTUSER = 2,
OLECMDEXECOPT_SHOWHELP = 3
For this parameter, in general, 1 May.

4 commonly used:
WebBrowser.ExecWB(1,1) Open
WebBrowser.ExecWB(2,1) Now close all IE windows, and open a new window
WebBrowser.ExecWB(4,1) Save Webpage
WebBrowser.ExecWB(6,1) Print
WebBrowser.ExecWB(7,1) Print preview
WebBrowser.ExecWB(8,1) The printed page setup
WebBrowser.ExecWB(10,1) See page properties
WebBrowser.ExecWB(15,1) Seems to be revoked, subject to confirmation
WebBrowser.ExecWB(17,1) Select all
WebBrowser.ExecWB(22,1) Refresh
WebBrowser.ExecWB(45,1) The closed form no cue

The 5 example﹕
(a)Call IE "save as" functions of sample﹕
<object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>
<A href=".:WebBrowser.ExecWB(4,1);">Save- storage</A>

(b)After the rewriting of the landing mode
<object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>
<body .load="showModalDialog('login_access.asp',0,'Status:NO;dialogWidth:418px;dialogHeight:288px');document.all.WebBrowser.ExecWB(45,1);">

<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT> 
<input name=Button .Click=document.all.WebBrowser.ExecWB(1,1) Type=button value= open>
<input name=Button .Click=document.all.WebBrowser.ExecWB(2,1) Type=button value= to close all>
<input name=Button .Click=document.all.WebBrowser.ExecWB(4,1) Type=button value= save as> 
<input name=Button .Click=document.all.WebBrowser.ExecWB(6,1) Type=button value= print>
<input name=Button .Click=document.all.WebBrowser.ExecWB(6,6) Type=button value= direct printing>
<input name=Button .Click=document.all.WebBrowser.ExecWB(7,1) Type=button value= Print Preview>
<input name=Button .Click=document.all.WebBrowser.ExecWB(8,1) Type=button value= page setup>
<input name=Button .Click=document.all.WebBrowser.ExecWB(10,1) Type=button the value= attribute>
<input name=Button .Click=document.all.WebBrowser.ExecWB(17,1) Select type=button value=>
<input name=Button .Click=document.all.WebBrowser.ExecWB(22,1) Type=button value= refresh>
<input name=Button .Click=document.all.WebBrowser.ExecWB(45,1) Type=button value= close>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Amos at July 06, 2014 - 1:04 AM