I found these 2 subs on the website you mentioned earlier
Public Static Sub ListAllLinkUrls(doc as HTMLdocument, List As ListBox)
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
ListAllLinks doc.frames(i), List
Next i
End If
End Sub
Public Static Sub ListAllLinks(doc as HTMLdocument, List As ListBox)
If doc.frames.length = 0 Then
For i = 0 To doc.links.length - 1
List.AddItem doc.links(i).outerText
Next i
Else
For i = 0 To doc.frames.length - 1
ListAllLinks doc.frames(i), List
Next i
End If
End Sub
But I got stuck on HTMLdocument. That type doesn't exist
it is being regarded as user-defined but I haven't defined it or set it to any object
THe usage code is for the webbrowser and a listbox like this:
ListAllLinks webbrowser1.document, List1
and all links on the page should be listed in a list box (or the link text if using this second sub)
any ideas?




Reply With Quote