Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing open IE modal window

Status
Not open for further replies.

joelflorendo

Technical User
Dec 5, 2004
92
US
I want to have my access form insert text into an IE textbox that is already open. The problem I'm having is that the window where the textbox lives is an IE Modal Dialog window. I can't figure out how to grab that window so I can get the textbox and insert text into it. Anyone have any ideas?
 
Have a look here:
faq707-6399

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks for the reply. I've used similar code and it doesn't seem to work for me. It can find the parent window no problem. But the window I want to grab is a modal web dialog window. The method in the thread you pointed me to doesn't seem to see the modal window...am I missing something?
 
joelflorendo,
In a word, No, your not missing anything.

The modal IE window does not register as it's own application so the code in the FAQ ([tt]GetIEApp[/tt]) doesn't see it.

I spent about 30 minutes digging around MSDN and I can't figure out where the modal window is registered, so I have no idea how to get to it from the window it was spawned from.

I got the impression from the literature that you can reference the objects on the modal window as if they exist on the source window (IE Application) but that just doesn't sound right to me and I don't have time right now to build some dummy pages to test it.

Sorry I don't have more information for you...
CMP
 
yeah, i actually found it is a child window of the desktop. i was able to get it's handle by using EnumChildWindows api but i can't figure out how to get the web page's document object from there...any suggestions?
 
I tested out if you can reference objects in the modal window from the source window and it didn't work. (Thanks by the way to CautionMP for taking the time to search around MSDN for an answer. I really appreciate it). I was able to get the source code of the modal dialog box by sifting through a bunch of javascript and found the id of the textarea I want to reference. I attempted to reference it using getElementById from the source window's document object but it didn't find it so I'm guessing you can't get it from there.

I'm still wondering if there's a way to get the document object somehow if you know the handle of the window that contains it....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top