Hi all,
I'm using the following code from to get all of the links from a webpage into a listbox.
This part is working perfectly.
I'm attempting to add the text from the webpage, into another listbox, that corresponds to the appropriate URL in the first listbox(from the code above). So, the listbox index, from both indexes will correspond with eachother.(text from webpage & appropriate url)
If I need to clarify any of the above, please let me know.
Any tips or pointers would be greatly appreciated.
Best regards,
Wray
***You can't change your past, but you can change your future***
I'm using the following code from to get all of the links from a webpage into a listbox.
Code:
Dim objLink As HTMLLinkElement
Dim objMSHTML As New MSHTML.HTMLDocument
Dim objDocument As MSHTML.HTMLDocument
' This function is only available with Internet Explorer 5
Set objDocument = objMSHTML.createDocumentFromUrl(txtURL.Text, _
vbNullString)
' Tricky, to make the function wait for the document to
' complete, usually the transfer is asynchronous. Note
' that this string might be different if you have another
' language than English for Internet Explorer on the
' machine where the code is executed.
While objDocument.readyState <> "complete"
DoEvents
Wend
' Source Code
Debug.Print = objDocument.documentElement.outerHTML
' Title
Debug.Print "Title : " & objDocument.Title
' Link Collection
For Each objLink In objDocument.links
lstLinks.AddItem objLink
Debug.Print "Link: " & objLink
Next
This part is working perfectly.
I'm attempting to add the text from the webpage, into another listbox, that corresponds to the appropriate URL in the first listbox(from the code above). So, the listbox index, from both indexes will correspond with eachother.(text from webpage & appropriate url)
If I need to clarify any of the above, please let me know.
Any tips or pointers would be greatly appreciated.
Best regards,
Wray
***You can't change your past, but you can change your future***