LocationURL of webBrowser control

Is there a way to store information from LocationURL to use as History?

Thanks,

Kurt
LVL 11
kmartin7Asked:
Who is Participating?
 
Richie_SimonettiConnect With a Mentor IT OperationsCommented:
Option Explicit
Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long

Private Sub Form_Load()
WebBrowser1.Navigate "www.microsoft.com"
End Sub


Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Static Counter As Integer
If (pDisp Is WebBrowser1.Object) Then
    Dim ret As Long
    ret = WritePrivateProfileString("History", "url" & Counter, CStr(WebBrowser1.LocationURL), "c:\History.log")
    If ret = 0 Then
        MsgBox "an error ocurred while saveing url"
    End If
    Counter = Counter + 1
End If
End Sub
0
 
devthaCommented:
save the url into a text file opened for append. The file can be named as URLHistory.log and saved in the app.path folder.
0
 
wsh2Commented:
Yes.. <smile>
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
kmartin7Author Commented:
Okay, for the 250 points, how about some sample code? I am not very VB literate as of yet.

Kurt
0
 
Richie_SimonettiIT OperationsCommented:
hearing...
0
 
Richie_SimonettiIT OperationsCommented:
Thanks!
0
 
devthaCommented:
that was my solution you should have waited for me to give you the code. Well ...
0
 
kmartin7Author Commented:
Let's see your code...
0
 
Richie_SimonettiIT OperationsCommented:
pardon... your code?
I did that code all the time, see my profile.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.