Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLE Get URL from Clicked Linked.

Status
Not open for further replies.

krieg313

Technical User
May 5, 2011
22
US
Well the title says it all, how would i get the url of the link i just clicked?

Dim ObjForTesting As Object
Dim Link As Object
Dim ElementCol As Object

Set ObjForTesting = CreateObject("InternetExplorer.Application")
With ObjForTesting
.Visible = True
.navigate "While .Busy
DoEvents
DoEvents
Wend
End With

Set ElementCol = ObjForTesting.Document.getElementsByTagName("a")

For Each Link In ElementCol
If Link.innerHTML = "S0002" Then ' <- link text with no URL.
Link.Click
Exit For
End If
Next Link
Debug.Print NewURLHere.LocationURL

The URL i want is the url you get when u right click window - > properties, this link window does not have a url text bar.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top