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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get LinkText & LinkHref from Inet

Status
Not open for further replies.

samphdauto

Technical User
Nov 27, 2002
11
GB
Hello
I have this code which was given by a programmer. it extracts the LinkText and LinkHref from a WebBrowser.

Could any one help. I need a code to use on Inet control.

thanks alot

Sam

Option Explicit
Public Type LinkInfo
LinkText As New Collection
LinkHref As New Collection
End Type

Public Function GetLinkInfo(WB As WebBrowser) As LinkInfo
'This will return all of the links in the page with
'the url of the link and the text (if any).
'then run through the UDT Collections testing the
'innertext/LinkText against the string you are wanting to find.

Dim L

For Each L In WB.Document.Links
GetLinkInfo.LinkHref.Add L.Href
GetLinkInfo.LinkText.Add L.innertext
Next

End Function



Private Sub cmdExtract_Click()
Dim MyInfo As LinkInfo
Dim c As Long

c = 1
MyInfo = GetLinkInfo(WB1)
Do Until c = MyInfo.LinkText.Count + 1
MsgBox MyInfo.LinkText.Item(c) & " " & MyInfo.LinkHref.Item(c)
c = c + 1
Loop
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top