OK, this should do it.I've added a check for the page title because otherwise you wouldn't be able to have any other IE windows opened.
VB Code:
Dim objWindows As Object, objIE As Object, i As Integer Set objWindows = CreateObject("Shell.Application").windows If objWindows.Count > 0 Then 'Make sure there are windows For Each objIE In objWindows If InStr(1, objIE.FullName, "IEXPLORE.EXE", vbTextCompare) <> 0 Then 'IE instead of Windows Explorer If InStr(1, LCase(objIE.Document.Title), "website.com") <> 0 Then 'Checking if the title contains "website.com" For i = 0 To objIE.Document.links.length - 1 'Loop through the links collection If objIE.Document.links.Item(i).innerText = "Click here" Then 'If the link text is the one we're looking for objIE.Navigate objIE.Document.links.Item(i) 'Navigate to the page End If Next i End If End If Next End If Set objWindows = Nothing Set objIE = Nothing




I've added a check for the page title because otherwise you wouldn't be able to have any other IE windows opened.
Reply With Quote