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:
  1. Public Sub ListAllLinkUrls(doc As HTMLDocument, List As ListBox)
  2.     Dim i As Long
  3.     Dim x As Long
  4.    
  5.     If doc.frames.length = 0 Then
  6.         For i = 0 To doc.links.length - 1
  7.             List.AddItem doc.links(i).href
  8.         Next i
  9.     Else
  10.         For i = 0 To doc.frames.length - 1
  11.             For x = 0 To doc.frames(i).Document.links.length - 1
  12.                 List.AddItem doc.frames(i).Document.links(x).href
  13.             Next x
  14.         Next i
  15.     End If
  16. End Sub
  17.  
  18. Public Sub ListAllLinks(doc As HTMLDocument, List As ListBox)
  19.     Dim i As Long
  20.     Dim x As Long
  21.    
  22.     If doc.frames.length = 0 Then
  23.         For i = 0 To doc.links.length - 1
  24.             If doc.links(i).outerText <> "" Then
  25.                 List.AddItem doc.links(i).outerText
  26.             End If
  27.         Next i
  28.     Else
  29.         For i = 0 To doc.frames.length - 1
  30.             For x = 0 To doc.frames(i).Document.links.length - 1
  31.                 If doc.frames(i).Document.links(x).outerText <> "" Then
  32.                     List.AddItem doc.frames(i).Document.links(x).outerText
  33.                 End If
  34.             Next x
  35.         Next i
  36.     End If
  37. End Sub