I'm using the following code to get the
current URL and Title from IE. My only issue is that this only works on
one session of IE. If I have multiple IE sessions open, I would like to
get the active or current session of IE and grab the URL and Title. Can
someone help me modify my code to do that or point me to an example?
Thank you
Patrick
frmMain.TxtDDE.LinkTopic =
"iexplore|WWW_GetWindowInfo"
frmMain.TxtDDE.LinkItem =
&HFFFFFFFF
frmMain.TxtDDE.LinkMode =
2
frmMain.TxtDDE.LinkRequest
' parse out info given to us by ie
in
' txtDDE.Text; should be in the
form
'
"URL","Page title"
Dim cc As Long,
parms(2) As String, quoting As Boolean
Dim thisParm As
Integer, p As Long, c As Byte
thisParm =
1
quoting = False
For i = 1 To
Len(frmMain.TxtDDE)
c =
Asc(Mid(frmMain.TxtDDE, i, 1))
Select Case
c
Case
34 ' quotation
mark
quoting = Not
quoting
Case 44 '
comma
If Not quoting
Then
thisParm = thisParm +
1
If thisParm > 2 Then Exit
For
End If
Case
Else
If quoting
Then
parms(thisParm) = parms(thisParm) &
Chr(c)
End If
End
Select
Next i
URL = parms(1)
title = parms(2)