VB 6.0 - internet explorer object invokescript

Asked By peter on 02-Jul-10 05:48 AM

using vb6, i have created an object of internet explorer and can navigate to the a page, fill textboxes etc, but i need to call a javascript function on the page, seems like invokescript should work but i get an error, method does not exist

ie.document.invokescript "test", "123"
the test script is just to show a dialog with the passed string,


am i doing something wrong, or does invokescript just not work like this

Ken Fitzpatrick replied to peter on 02-Jul-10 07:10 AM

Peter,


I went to http://msdn.microsoft.com/en-us/library/4b1a88bz(VS.80).aspx and it says at the top of the page that InvokeScript is new to .NET 2.0. Maybe there is another way to accomplish your task. Is there any reason you can't do this using VB.NET instead of VB6? I'll dig around and see if there is anything else you could try.


Ken

samjayander thiagarajan replied to peter on 02-Jul-10 07:55 AM
Hi,

did, you tried using execScript method:

WebBrowser.Document.parentWindow.execScript(...)

Regards,
Sam.
peter replied to samjayander thiagarajan on 04-Jul-10 05:38 AM
WebBrowser.Document.parentWindow.execScript(...)

thanx, that works