Crea un formulario con un submenú de nombre mnuFavorite e índice 0, y un archivo de texto en el directorio del proyecto que se llame favoritos.txt
En favoritos.txt escribir lo siguiente:
Algoritmica:http://www.algoritmica.com.ar/
el Guille:http://www.elguille.info/default.aspx
VBPrincipiantes:http://www.vbprincipiantes.com/
Los datos se guardan por lineas, y de a par:
Descripción:UrlOption Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, Optional ByVal lpParameters As String, Optional ByVal lpDirectory As String, Optional ByVal nShowCmd As Long) As Long
Property Get AppPath() As String
AppPath = App.Path
If (Right$(AppPath, 1) <> "\") Then AppPath = AppPath & "\"
End Property
Sub LoadMenus()
On Error GoTo Errors
Dim hFile%, iCnt%
Dim sLine$, iPos%
hFile = FreeFile
Open AppPath & "favoritos.txt" For Input As #hFile
iCnt = -1
Do
iCnt = iCnt + 1
If iCnt > 0 Then
Call Load(mnuFavorite(iCnt))
End If
Line Input #hFile, sLine
iPos = InStr(1, sLine, ":")
mnuFavorite(iCnt).Caption = Left$(sLine, iPos - 1)
mnuFavorite(iCnt).Tag = Mid$(sLine, iPos + 1)
mnuFavorite(iCnt).Visible = True
Loop While (Not EOF(hFile))
Errors:
Close #hFile
End Sub
Private Sub Form_Load()
Call LoadMenus
End Sub
Private Sub mnuFavorite_Click(Index As Integer)
Call ShellExecute(0&, vbNullString, mnuFavorite(Index).Tag)
End Sub
Prueba el code y haz click en uno de los menús, voilà.