I think you should use a listbox to store the Web addresses and use this code to save and load them to and from the listbox.
And you can have it so that when the user double clicks on the listbox, it will open the default browser and go to that site.Code:Public Sub List_Load(TheList As ListBox, FileName As String) On Error Resume Next Dim TheContents As String Dim fFile As Integer fFile = FreeFile Open FileName For Input As fFile Do Line Input #fFile, TheContents$ TheList.Additem TheContents$ Loop Until EOF(fFile) Close fFile End Sub Public Sub List_Save(TheList As ListBox, FileName As String) On Error Resume Next Dim Save As Long Dim fFile As Integer fFile = FreeFile Open FileName For Append As fFile For Save = 0 To TheList.ListCount - 1 Print #fFile, TheList.List(Save) Next Save Close fFile End Sub
Code:Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Public Const SW_SHOWNORMAL = 1 Private Sub List1_DblClick() ShellExecute Me.hWnd, vbNullString, List1, vbNullString, "c:\", SW_SHOWNORMAL End Sub




Reply With Quote