Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9165003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:48:54+00:00 2026-06-17T14:48:54+00:00

Language/Software: The language is VBA. The application is Access 2003 (I also can use

  • 0

Language/Software:

The language is VBA. The application is Access 2003 (I also can use Excel) and Internet Explorer (on Windows XP/Seven).

The problem:

I’m developing a Access macro which opens and manipulates a intranet site of the enterprise where I work.

I can create new IE windows and fill data in the forms, but I need to be able of intercept and manipulate other IE windows, such as popups, which opens when I click on a link, when I choose an option of a select element or when the page is loaded.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:48:55+00:00Added an answer on June 17, 2026 at 2:48 pm

    Here’s some code I use to get an IE window from it’s title. It’s split into two functions because one of my users was having an extremely odd problem where an error was not being caught properly. You might (probably will) be able to move the body of the private function into the public function.

    Additionally, you’ll need to set a reference to Microsoft Internet Controls (this is either shdocvw.dll or ieframe.dll, depending on your version of Windows) and I’d recommend setting a reference to Microsoft HTML Object Library to make it easier to traverse the DOM once you have your IE object.

    Function oGetIEWindowFromTitle(sTitle As String, _
                                   Optional bCaseSensitive As Boolean = False, _
                                   Optional bExact As Boolean = False) As SHDocVw.InternetExplorer
    
        Dim objShellWindows As New SHDocVw.ShellWindows
        Dim found As Boolean
        Dim startTime As Single
    
        found = False
        'Loop through shell windows
        For Each oGetIEWindowFromTitle In objShellWindows
            found = oGetIEWindowFromTitleHandler(oGetIEWindowFromTitle, sTitle, bCaseSensitive, bExact)
            If found Then Exit For
        Next
    
        'Check whether a window was found
        If Not found Then
            Set oGetIEWindowFromTitle = Nothing
        Else
            pauseUntilIEReady oGetIEWindowFromTitle
        End If
    
    End Function
    
    Private Function oGetIEWindowFromTitleHandler(win As SHDocVw.InternetExplorer, _
                                          sTitle As String, _
                                          bCaseSensitive As Boolean, _
                                          bExact As Boolean) As Boolean
    
        oGetIEWindowFromTitleHandler = False
    
        On Error GoTo handler
        'If the document is of type HTMLDocument, it is an IE window
        If TypeName(win.Document) = "HTMLDocument" Then
            'Check whether the title contains the passed title
            If bExact Then
                If (win.Document.title = sTitle) Or ((Not bCaseSensitive) And (LCase(sTitle) = LCase(win.Document.title))) Then oGetIEWindowFromTitleHandler = True
            Else
                If InStr(1, win.Document.title, sTitle) Or ((Not bCaseSensitive) And (InStr(1, LCase(win.Document.title), LCase(sTitle), vbTextCompare) <> 0)) Then oGetIEWindowFromTitleHandler = True
            End If
        End If
    handler:
        'We assume here that if an error is raised it's because
        'the window is not of the correct type. Therefore we
        'simply ignore it and carry on.
    
    End Function
    

    Use the above code as follows:

    Sub test()
    
        Dim ie As SHDocVw.InternetExplorer
        Dim doc As HTMLDocument 'If you have a reference to the HTML Object Library
        'Dim doc as Object 'If you do not have a reference to the HTML Object Library
    
        ' Change the title here as required
        Set ie = oGetIEWindowFromTitle("My popup window")
        Set doc = ie.Document
    
        Debug.Print doc.getElementsByTagName("body").Item(0).innerText
    
    End Sub
    

    You can find a window from almost any property of the window, or it’s document contents. If you’re struggling with this, please comment :).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can software be written (for some specific programming language, platform, etc.) that will inform
it can be any language. is there a library, software, or plugin that will
Which programming language is suitable to create an application software like text to voice
my primary language is spanish, but I use all my software in english, including
in which database software / language is it possible to create a database accessible
Is JVM software based? If so in which language is JVM coded?
Coding Language: C# Framework: .NET We have built a software, which among many other
Using Visual Studio 2005 Language: c# A new to c# I have software, the
Are there any software packages or projects that provide the scripting language shells? I
Is there any software around that using the Fitch format (used in Language, Proof

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.