wengang - Ok I think I have it now. I had altered the code originally so it would work with framed pages. In doing so, it made it non-functional for pages that aren't framed. It should now work for both.
VB Code:
Public Sub ListAllLinkUrls(doc As HTMLDocument, List As ListBox) Dim i As Long Dim x As Long If doc.frames.length = 0 Then For i = 0 To doc.links.length - 1 List.AddItem doc.links(i).href Next i Else For i = 0 To doc.frames.length - 1 For x = 0 To doc.frames(i).Document.links.length - 1 List.AddItem doc.frames(i).Document.links(x).href Next x Next i End If End Sub Public Sub ListAllLinks(doc As HTMLDocument, List As ListBox) Dim i As Long Dim x As Long If doc.frames.length = 0 Then For i = 0 To doc.links.length - 1 If doc.links(i).outerText <> "" Then List.AddItem doc.links(i).outerText End If Next i Else For i = 0 To doc.frames.length - 1 For x = 0 To doc.frames(i).Document.links.length - 1 If doc.frames(i).Document.links(x).outerText <> "" Then List.AddItem doc.frames(i).Document.links(x).outerText End If Next x Next i End If End Sub




Reply With Quote