Get a reference to the currently running IE ?

G

Guest

I know that to create a new instance of IE, I can use:

Dim oIE As InternetExplorer
Set oIE = New InternetExplorer

How does one get a reference to the current instance? I tried "GetObject"
but I must be doing something wrong. I won't post since it fails anyway.

Thanks in advance.
 
C

CodeSponge

What type of Ref?

if u want the value of a form field or something like that its
oIE.Document.formName("fieldName").value

if u want the body source to parse then try
sVar = oIE.Document.Body.innerhtml


etc...
 
G

Guest

I thought my original post was clear, but I meant to ref the currently
running IE application itself...can you help me out?
 
C

CodeSponge

O, ic, sorry about that.
you could try something like the following


Public Declare Function FindWindow& Lib "user32" Alias "FindWindowA"
(ByVal lpClassName$, ByVal lpWindowName$)

and then call it like this

hMessageBox = FindWindow("#32770", "WindowName")

I this is what I do when I want to grab a msg box and kill it.
I'm not sure what the lpClassName for IE would be tho
hope it helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top