Archive of UserLand's first discussion group, started October 5, 1998.

Getting the URL of the Front IE Window w/ VBScript

Author:Brent Simmons
Posted:12/18/1998; 5:11:00 PM
Topic:Getting the URL of the Front IE Window w/ VBScript
Msg #:1453
Prev/Next:1452 / 1454

Here's a question for VBScript experts:

I'm trying to get the URL of the frontmost window in Internet Explorer.

My code looks like this:

Sub Main

Dim ie

Set ie = GetObject ("", "InternetExplorer.Application")

MsgBox ie.LocationURL

End Sub

When I call it, the MsgBox window is always empty. I've checked in the documentation that I'm retrieving the correct property. I've also tried other properties: locationName also doesn't work, but Parent, for example, does work.

I've also read the docs enough to know that GetObject gets an existing object: I don't want to use CreateObject because I want the URL of the window that's already open, I don't want to create a new window.

I'm running IE 4.0.1 on NT, if that's relevant.


There are responses to this message:


This page was archived on 6/13/2001; 4:46:45 PM.

© Copyright 1998-2001 UserLand Software, Inc.