VBScript - Find IE window

Posted on 2006-05-10
Last Modified: 2007-12-19
I was wondering if anyone knew how to find if a certain IE window is open (by it's window title) using VBScript.

I'm looking for the VBScript equivalent of this this code:

Dim IE() as Process
Dim n as Integer
Dim bOpen As Boolean = False
IE = Process.GetProcessesByName("IEXPLORE")
If IE.Length > 0 Then
    For n = 0 to IE.Length - 1
        If IE(n).MainWindowTitle.StartsWith("Website A") Then
            MsgBox("Website A is open")
            Exit For
        End If
End If

Question by:CaitlinRoberts
    LVL 28

    Accepted Solution

    Dim shWin
    Dim i

    Set shWin = CreateObject("Shell.Application")
    For i = 0 To - 1
        If Left(, 9) = "Website A" Then
            MsgBox "Website A is open"
            Exit For
        End If

    Author Comment

    Perfect!  Thanks AzraSound!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Introduction This article makes the case for using two modules in your VBA/VB6 applications to provide both case-sensitive and case-insensitive text comparison operations.  Recently, I solved an EE question using the LIKE function.  In order for th…
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now