• Welcome to Valhalla Legends Archive.
 

Scripting InternetExplorer from external app.

Started by Grok, May 30, 2003, 10:27 AM

Previous topic - Next topic

Grok

From an external application, for example a standard EXE built with Visual Basic, I want to script ActiveX objects that are loaded inside an Internet Explorer browser window.

I can't find the IE Object Model reference that is needed.  What I have:

Dim IE as Object
Set IE = GetObject("", "InternetExplorer.Application")

This works, but I'm not sure the object I'm getting is the IE window that is already open.  When I close all IE windows and run this, it still succeeds in getting an object instance of InternetExplorer.Application.

And -- If there were multiple IE's running, how would I get the correct window?  I am not aware of any GetObjectNext() call.

Once there, can someone find an object model chart that I can drill down from the "Application" object to the Document elements objects?


Dumb_Canadian

#1
Good question!

I'm not sure about how the object behaves when there's multiple instances of IE running. It'd be interesting to know if you could clearly define which instance of IE you'd like to automate, but I couldn't find out if that's at all possible. Regardless, Here's a reference for the IE Object Model that the shdocvw.dll library exposes. Also, shdocvw.dll (The WebBrowser Control,) inherits the mshtml.dll (The MSHTML Control) library, which is what handles ActiveX Controls and such, IIRC, so this reference may also be of some use.

Anywho, hope that helps. Btw, this article very nicely documents the architect of IE.