Alright, I have a webbrowser, and I want to know if there is a way to get the LocationURL of each page visited added to a listview on a different form? If it is possible, can someone give me a Hint as to how...
Printable View
Alright, I have a webbrowser, and I want to know if there is a way to get the LocationURL of each page visited added to a listview on a different form? If it is possible, can someone give me a Hint as to how...
Give this a shot :thumb:
vb Code:
Dim bPageLoaded As Boolean Private Sub Command1_Click() WB1.Navigate ("http://www.google.com") Do Until bPageLoaded = True DoEvents Loop End Sub Private Sub Command2_Click() Form2.Show End Sub Private Sub WB1_DocumentComplete(ByVal pDisp As Object, URL As Variant) If WB1 = pDisp Then bPageLoaded = True Form2.ListView1.ListItems.Add , , URL End If End Sub
Well, thatt worked to an extent... I went to vbforums and it displayed the url, but it also displayed this... http://view.atdmt.com/MRT/iview/ntii...7118814?click=
Also, it shows the itms in only part of the list view, I have tried to change that, but I cant figur out how to make it so that no matter how the form is resized it will show the whole url...
PS. Is it possible to save all the urls to a DAT file so that when ever a webbrowser is visited it will add it to the dat file? then the list view will take from the dat file?
Replace
withvb Code:
Form2.ListView1.ListItems.Add , , URL
vb Code:
Form2.ListView1.ListItems.Add , , WB1.LocationURL
If you want the URL to be added to a .DAt file instead of a listview change the below...
to...vb Code:
Form2.ListView1.ListItems.Add , , WB1.LocationURL
vb Code:
Open App.Path & "\URL.dat" For Append As #1 Print #1, WB1.LocationURL CLose #1
Well, it worked great... but now how do I make it load the information from the data file? :sick:
OK, try this.
vb Code:
Private Sub Form_Load() Open App.Path & "\URL.dat" for Input As #1 Do Until EOF(1) = True Line Input #1, s 'get the URL Form2.ListView1.ListItems.Add , , s Loop Close #1 End Sub
I am just assuming, but if I add this to the documentcomplete instead or form load it will constantly add it to the the dat file and update the listview... Is that right?
Also, it says true line isnt defined...:confused: