From: at on
Paul Randall avait pr�tendu :

> Hi, Tom
> I tried your script and get this:
> Script: G:\VBScript\JS-VB-Array\Test2.vbs
> Line: 4
> Char: 1
> Error: Object doesn't support this property or method:
> 'ie.document.parentWindow.js_mbv_ipinterfaceipaddress'
> Code: 800A01B6
> Source: Microsoft VBScript runtime error
>
> Same error with ie.visible true or false.
>
> Is it perhaps a security level setting that is the problem? I'm running IE6
> on WXP SP2.

IE8 same, but try

ie.visible=true
msgbox "look advert in IE...and choose"
msgbox ie.document.parentWindow.js_mbv_ipinterfaceipaddress


From: Tom Lavedas on
On Apr 21, 3:42 pm, "Paul Randall" <paulr...(a)cableone.net> wrote:
> "Tom Lavedas" <tglba...(a)verizon.net> wrote in message
>
> news:f7f1e9e1-7e8f-494f-a36e-d938c01f35db(a)n5g2000yqh.googlegroups.com...
> On Apr 21, 9:14 am, at <a...(a)noemail.fr> wrote:
>
>
>
> > Tom Lavedas a utilisé son clavier pour écrire :
>
> > > Try something like this ...
>
> > > Set objShell = WScript.CreateObject("WScript.Shell" )
> > > Set ie = CreateObject("InternetExplorer.Application")
> > > ie.navigate "d:\example.htm"
> > > wsh.echo ie.document.parentWindow.js_mbv_ipinterfaceipaddress
>
> > > I think the same approach will access the array variable, but I'm not
> > > certain whether JScript arrays are compatible with VBScript. Try
> > > something like this ...
>
> > > wsh.echo Join(ie.document.parentWindow.dhcp_data, vbCRLF)
>
> > Thx, i try it, but not work. Regard.
>
> I tested this and it worked fine with the second example you
> posted ...
>
> Set ie = CreateObject("InternetExplorer.Application")
> ie.navigate "d:\example.html"
> do until ie.readystate = 4: wsh.sleep 100 : loop
> wsh.echo ie.document.parentWindow.js_mbv_ipinterfaceipaddress
> ie.document.parentWindow.opener = "Me"
> ie.document.parentWindow.close
>
> This same approach also worked for connecting to the dhcp_data
> variable in your first example, but as I expected, JScript arrays are
> a problem in VBS.  From a quick search, I found that JScript arrays
> are *objects* and need to be treated as such.  They are NOT directly
> usable as VBS arrays.  I did not find an example of a way to convert
> an arbitrary JS array into a VBS array.  Most of the examples I found
> modified the JS array and wrote JS functions to provide indexing into
> the JS array so it could be converted to a VBS array, element by
> element.  Your problem is even more complex in that your target
> variable is an array of arrays.  Good luck.  This problem is beyond my
> skills. - Maybe a rewrite of your VBS script into JS is the way to go.
> _____________________
> Tom Lavedas
>
> Hi, Tom
> I tried your script and get this:
> Script: G:\VBScript\JS-VB-Array\Test2.vbs
> Line: 4
> Char: 1
> Error: Object doesn't support this property or method:
> 'ie.document.parentWindow.js_mbv_ipinterfaceipaddress'
> Code: 800A01B6
> Source:  Microsoft VBScript runtime error
>
> Same error with ie.visible true or false.
>
> Is it perhaps a security level setting that is the problem?  I'm running IE6
> on WXP SP2.
>
> -Paul Randall

My testing was with IE6 and WXPSP2. The code approach isvalid, I use
it all the time.

Check to see if there was possibly an error in the example.htm page?
That would cause my script to fail with the message you encountered.
Look at the status bar in IE. It might say something like, "Done with
error on page". If that's the case, the code that instantiates the
variable failed and the variable was not created.
_____________________
Tom Lavedas
From: Paul Randall on

"Tom Lavedas" <tglbatch(a)verizon.net> wrote in message
news:ad922336-f708-4b49-a5be-b04ac70ca26c(a)q15g2000yqj.googlegroups.com...
On Apr 21, 3:42 pm, "Paul Randall" <paulr...(a)cableone.net> wrote:
> "Tom Lavedas" <tglba...(a)verizon.net> wrote in message
>
> news:f7f1e9e1-7e8f-494f-a36e-d938c01f35db(a)n5g2000yqh.googlegroups.com...
> On Apr 21, 9:14 am, at <a...(a)noemail.fr> wrote:
>
>
>
> > Tom Lavedas a utilis� son clavier pour �crire :
>
> > > Try something like this ...
>
> > > Set objShell = WScript.CreateObject("WScript.Shell" )
> > > Set ie = CreateObject("InternetExplorer.Application")
> > > ie.navigate "d:\example.htm"
> > > wsh.echo ie.document.parentWindow.js_mbv_ipinterfaceipaddress
>
> > > I think the same approach will access the array variable, but I'm not
> > > certain whether JScript arrays are compatible with VBScript. Try
> > > something like this ...
>
> > > wsh.echo Join(ie.document.parentWindow.dhcp_data, vbCRLF)
>
> > Thx, i try it, but not work. Regard.
>
> I tested this and it worked fine with the second example you
> posted ...
>
> Set ie = CreateObject("InternetExplorer.Application")
> ie.navigate "d:\example.html"
> do until ie.readystate = 4: wsh.sleep 100 : loop
> wsh.echo ie.document.parentWindow.js_mbv_ipinterfaceipaddress
> ie.document.parentWindow.opener = "Me"
> ie.document.parentWindow.close
>
> This same approach also worked for connecting to the dhcp_data
> variable in your first example, but as I expected, JScript arrays are
> a problem in VBS. From a quick search, I found that JScript arrays
> are *objects* and need to be treated as such. They are NOT directly
> usable as VBS arrays. I did not find an example of a way to convert
> an arbitrary JS array into a VBS array. Most of the examples I found
> modified the JS array and wrote JS functions to provide indexing into
> the JS array so it could be converted to a VBS array, element by
> element. Your problem is even more complex in that your target
> variable is an array of arrays. Good luck. This problem is beyond my
> skills. - Maybe a rewrite of your VBS script into JS is the way to go.
> _____________________
> Tom Lavedas
>
> Hi, Tom
> I tried your script and get this:
> Script: G:\VBScript\JS-VB-Array\Test2.vbs
> Line: 4
> Char: 1
> Error: Object doesn't support this property or method:
> 'ie.document.parentWindow.js_mbv_ipinterfaceipaddress'
> Code: 800A01B6
> Source: Microsoft VBScript runtime error
>
> Same error with ie.visible true or false.
>
> Is it perhaps a security level setting that is the problem? I'm running
> IE6
> on WXP SP2.
>
> -Paul Randall

My testing was with IE6 and WXPSP2. The code approach isvalid, I use
it all the time.

Check to see if there was possibly an error in the example.htm page?
That would cause my script to fail with the message you encountered.
Look at the status bar in IE. It might say something like, "Done with
error on page". If that's the case, the code that instantiates the
variable failed and the variable was not created.
_____________________
Tom Lavedas
------------------------------------------------------------
Thanks, Tom

I use Microsoft Security Essentials to protect my PC. I was getting a
shield and done in the status bar, and the "To help protect your security,
Internet Explorer has restricted this file from showing active content that
could access your computer. Check here for options..." security thing,
which I wasn't paying attention to when running this script. Pausing the
script with a message box until I manually allowed the blocked content
removed the shield from the status bar and I now get the contents of the
JScript variable.

-Paul Randall