Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read arguments from IE Favorites into database?

Status
Not open for further replies.

ssecca

Programmer
Feb 13, 2002
219
US
I want to read the arguments from a shortcut in the favorites folder. In particular I am looking to read the URL and description into an access table. I tried .filesearch but it won't even see the shortcuts.

Please give me a place to start. I have been unable to find anything here or on MSDN.

Thanks
 
I already posted something like this.
Warning, this code has locale dependency.
Code:
Public Sub ScanFav()
    Dim Jdx As Long
    Dim DirName As String, FullFileName As String
    DirName = Environ("USERPROFILE") & "\Favoris" [green]' Don't know your folder name[/green]
    With Application.FileSearch
        .LookIn = DirName
        .FileName = "*.url"
        .FileType = msoFileTypeAllFiles
        .SearchSubFolders = True
        If .Execute > 0 Then
            For Jdx = 1 To .FoundFiles.Count
                FullFileName = .FoundFiles(Jdx)
                MsgBox FullFileName & vbCrLf & getWebAddress(FullFileName)
                'Add URL processing code here.......
            Next Jdx
        Else
            MsgBox "No files were found in this directory", vbInformation
        End If
    End With
End Sub

Public Function getWebAddress(urlFileName As String) As String
Dim InputData As String, i As Integer
Open urlFileName For Input As #1
Do While Not EOF(1)
  Line Input #1, InputData
  i = InStr(InputData, "URL=")
  If i > 0 Then
    getWebAddress = Mid(InputData, i + 4)
    Exit Do
  End If
Loop
Close #1
End Function

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
This does not seem to work. I have tried .filesearch before and it does not see the favorites as files or something. It will not see them regardless of how I modify the code. If I ad a text file into the directory it sees it but not the favorite shortcuts. Because of that I can not read the URL from the arguments or properties.

Any other suggestions ANYONE PLEASE. Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top