Hello, I'm making an updated version of the WebBrowser Program with new material, but I need the code of how to view the IE favorites that you've bookmarked on Visual Basic 6.
Help...?
Printable View
Hello, I'm making an updated version of the WebBrowser Program with new material, but I need the code of how to view the IE favorites that you've bookmarked on Visual Basic 6.
Help...?
Moved from the CodeBank
I think the favorites are kept in a directory under Documents and Settings\Your Name\Favorites
I think if you just do set a DirList path to that path you will get your favorites in a DirList box
Try thisCode:Option Explicit
Private Const CSIDL_FAVORITES = 6 '// Favorites
Private Const MAX_PATH As Integer = 260
Private Type SHFILEOPSTRUCT
hwnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAborted As Boolean
hNameMaps As Long
sProgress As String
End Type
Private Type SHIEMID
cb As Long
abID As Byte
End Type
Private Type ITEMIDLIST
mkid As SHIEMID
End Type
Private Declare Function SHGetSpecialFolderLocation Lib "Shell32.dll" _
(ByVal hwndOwner As Long, ByVal nFolder As Long, pidl As ITEMIDLIST) As Long
Private Declare Function SHGetSpecialFolderLocationD Lib "Shell32.dll" _
Alias "SHGetSpecialFolderLocation" (ByVal hwndOwner As Long, ByVal nFolder As Long, _
ByRef ppidl As Long) As Long
Private Declare Function SHGetPathFromIDList Lib "Shell32.dll" Alias _
"SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long
Private Function GetSpecialFolder(CSIDL As Long) As String
Dim sPath As String
Dim IDL As ITEMIDLIST
GetSpecialFolder = vbNullString
If SHGetSpecialFolderLocation(Form1.hwnd, CSIDL, IDL) = 0 Then
sPath = Space$(MAX_PATH)
If SHGetPathFromIDList(ByVal IDL.mkid.cb, ByVal sPath) Then
GetSpecialFolder = Left$(sPath, InStr(sPath, vbNullChar) - 1) & "\"
End If
End If
End Function
Private Sub Command1Click()
Dim MyFavorites As String
MyFavorites = GetSpecialFolder(CSIDL_FAVORITES)
MsgBox MyFavorites
End Sub
OK. How can I open the file on the menu 'Favorites' like Internet Explorer?Quote:
Originally Posted by Hack
A whole thing of the favorites that is...