Valhalla Legends Archive

Programming => Web Development => Topic started by: Grok on May 30, 2003, 10:27 AM

Title: Scripting InternetExplorer from external app.
Post by: Grok on May 30, 2003, 10:27 AM
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?

Title: Re:Scripting InternetExplorer from external app.
Post by: Dumb_Canadian on May 31, 2003, 12:30 AM
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 (http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/webbrowser/reference/objects/internetexplorer.asp) 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 (http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/mshtml/reference/reference.asp) reference may also be of some use.

Anywho, hope that helps. Btw, this (http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/overview/overview.asp) article very nicely documents the architect of IE.