System Windows Forms - Communication with Web Browser Control

darbid

Registered User.
Local time
Today, 16:08
Joined
Jun 26, 2008
Messages
1,428
I am currently sinking in stuff about .net being able to set up a communication to and from a web browser control. For example being able to execute an active script function in HTML.

Is this possible with good old VBA. If there a way to send events and items to HTML and get back the results of functions?
 
I know that you can use HTML collections as reference tools in VBA. and that's about all. I would assume you can, but I'll say that I have no idea how to do it. All I have done with HTML collections is reference controls on webpages and clicked buttons to automate browsing from within MS office programs.
 
Then so on the basis that I want to use the Microsoft Internet Explorer Internet (ActiveX Control) (or firefox or any) and not another application here is my christmas list.

I am using a local web page that I have made.

Call a Javascript function WITH variables eg.

Code:
[COLOR=blue]Call[/COLOR] IE.document.parentWindow.execScript("myJSfunction()", "JavaScript")
Problem I cannot see that the ActiveX controls expose this like the application does (as in the above example). I am not 100% sure how to pass a variable in.

Get something back from it. This works in theory be adding this to the JScript functions

Code:
var App = new ActiveXObject('MSAcess.Application')
App.Run(("receivedfromHTML", "arg1", "arg2", ...);
 
would anyone like to help me with access automation.

Code:
var App = new ActiveXObject('MSAcess.Application')
App.Run(("receivedfromHTML", "arg1", "arg2", ...);
needs to be padded out and I am not sure how.

after getting the access object how can I refer to an already opened mdb and then call a public sub. Should this routine be in a module?
 
OK so in COM it is just not going to happen. My work around is that as I am only using one HTML page and it is mine so I can send a request at the end of my Jscript functions to go to a new page. That page name being the variable I need from the Jscript function. I can then capture this from the beforenavigate2 event which will give me the "URL" in this case my variable and then I can cancel the navigation.

Thanks ajetrumpet for having a go.
 

Users who are viewing this thread

Back
Top Bottom