Thanks in Advance
Duke
To do it otherwise would be difficult. If you
look at Firefox in Spy++ you'll see that there
are few actual windows found. If you look at
it with Active Accessibility you can go down several
levels, into a sub-level of the rendering window,
and find the URL. But that's awkward and wouldn't
work for other browsers. (I have FF 1.5. There may
even be differences with later FF versions.)
Private Function GetIEURL() As String
On Error Resume Next
Dim strArray() As String
With lblIEURL
.Caption = ""
.AutoSize = True
.LinkTopic = "IExplore|WWW_GetWindowInfo"
.LinkItem = "0xffffffff"
.LinkMode = 2
.LinkRequest
End With
DoEvents
If Not lblIEURL.Caption = "" Then
strArray = Split(lblIEURL.Caption, ",")
GetIEURL = Replace(strArray(0), """", "")
End If
End Function