+ Reply to Thread
Results 1 to 4 of 4

Backing up IE Favorites

  1. #1
    Spammastergrand
    Guest

    Backing up IE Favorites

    Anyone know how to get at the object model of the favrites folder so I can
    back it up in Excel, Access Word, with VBA? Is it something like a
    filesystem object?

    What type of file is it anyway?



  2. #2
    Michel Pierron
    Guest

    Re: Backing up IE Favorites

    Hi Spammastergrand,
    Try:

    Sub FavoritesFolderSave()
    Dim FavoritesFolder As String
    FavoritesFolder = CreateObject("WScript.Shell") _
    ..SpecialFolders("Favorites")
    Application.ScreenUpdating = False
    Workbooks.Add
    Call FilesInFolder(FavoritesFolder, 0, True)
    End Sub

    Private Sub FilesInFolder(sFolderName As String _
    , Optional Rw As Long = 0 _
    , Optional SubDirs As Boolean = True)
    Dim FSO As Object, SourceFolder As Object
    Dim FileItem As Object, SubFolder As Object
    Set FSO = CreateObject("Scripting.FileSystemObject")
    Set SourceFolder = FSO.GetFolder(sFolderName)
    Rw = Rw + 1
    Cells(Rw, 1) = sFolderName
    Cells(Rw, 1).Font.Bold = True
    For Each FileItem In SourceFolder.Files
    Application.StatusBar = SourceFolder & FileItem.Name
    Rw = Rw + 1
    Cells(Rw, 2) = FileItem.Name
    Next FileItem
    If SubDirs Then
    For Each SubFolder In SourceFolder.SubFolders
    Rw = Rw + 1
    Call FilesInFolder(SubFolder.Path, Rw, True)
    Next SubFolder
    End If
    Application.StatusBar = False
    Columns("A:A").ColumnWidth = 2
    Set FileItem = Nothing
    Set SubFolder = Nothing
    Set SourceFolder = Nothing
    Set FSO = Nothing
    End Sub

    Regards,
    MP

    "Spammastergrand" <[email protected]> a écrit dans le message de
    news:wTIRd.74061$QS5.47026@trndny06...
    > Anyone know how to get at the object model of the favrites folder so I can
    > back it up in Excel, Access Word, with VBA? Is it something like a
    > filesystem object?
    >
    > What type of file is it anyway?
    >
    >



  3. #3
    Dave Peterson
    Guest

    Re: Backing up IE Favorites

    And stealing shamelessly from Michel...

    Option Explicit
    Sub FavoritesFolderSave2()

    Dim FavoritesFolder As String
    Dim BackUpFolder As String
    Dim FSO As Object

    FavoritesFolder = CreateObject("WScript.Shell") _
    .SpecialFolders("Favorites")

    BackUpFolder = Environ("Temp") 'windows temp folder
    'or an existing folder
    'BackUpFolder = "C:\myFavoritesBackedUp"

    Set FSO = CreateObject("scripting.filesystemobject")
    FSO.CopyFolder Source:=FavoritesFolder, Destination:=BackUpFolder

    End Sub

    ===
    I usually back up my Favorites manually.

    I do this:
    Windows start button|Run
    Favorites
    up one level
    copy that Favorites folder
    and paste to where I like it.

    Spammastergrand wrote:
    >
    > Anyone know how to get at the object model of the favrites folder so I can
    > back it up in Excel, Access Word, with VBA? Is it something like a
    > filesystem object?
    >
    > What type of file is it anyway?


    --

    Dave Peterson

  4. #4
    Michel Pierron
    Guest

    Re: Backing up IE Favorites

    Hi Spammastergrand,
    If you want also the short cuts, modify the FilesInFolder procedure as
    follows :

    Private Sub FilesInFolder(sFolderName As String _
    , Optional Rw As Long = 0 _
    , Optional SubDirs As Boolean = True)
    Dim FSO As Object, SourceFolder As Object
    Dim FileItem As Object, SubFolder As Object
    Dim FileType As String, n As String
    Set FSO = CreateObject("Scripting.FileSystemObject")
    Set SourceFolder = FSO.GetFolder(sFolderName)
    Rw = Rw + 1
    Cells(Rw, 1) = sFolderName
    Cells(Rw, 1).Font.Bold = True
    For Each FileItem In SourceFolder.Files
    Application.StatusBar = SourceFolder & FileItem.Name
    If InStr(1, FileItem.Type, "Internet", 1) Then
    Rw = Rw + 1
    Cells(Rw, 2) = FileItem.Name
    Rw = Rw + 1
    n = ReadFile(FileItem.Path)
    ActiveSheet.Hyperlinks.Add _
    Cells(Rw, 3), n, , n, n
    End If
    Next FileItem
    If SubDirs Then
    For Each SubFolder In SourceFolder.SubFolders
    Rw = Rw + 1
    Call FilesInFolder(SubFolder.Path, Rw, True)
    Next SubFolder
    End If
    Application.StatusBar = False
    Columns("A:B").ColumnWidth = 1
    Set FileItem = Nothing
    Set SubFolder = Nothing
    Set SourceFolder = Nothing
    Set FSO = Nothing
    End Sub

    Private Function ReadFile(FilePath) As String
    On Error Resume Next
    ReadFile = CreateObject("Wscript.Shell") _
    ..CreateShortcut(FilePath).TargetPath
    End Function

    Regards,
    MP

    "Michel Pierron" <[email protected]> a écrit dans le message de
    news:[email protected]...
    > Hi Spammastergrand,
    > Try:
    >
    > Sub FavoritesFolderSave()
    > Dim FavoritesFolder As String
    > FavoritesFolder = CreateObject("WScript.Shell") _
    > .SpecialFolders("Favorites")
    > Application.ScreenUpdating = False
    > Workbooks.Add
    > Call FilesInFolder(FavoritesFolder, 0, True)
    > End Sub
    >
    > Private Sub FilesInFolder(sFolderName As String _
    > , Optional Rw As Long = 0 _
    > , Optional SubDirs As Boolean = True)
    > Dim FSO As Object, SourceFolder As Object
    > Dim FileItem As Object, SubFolder As Object
    > Set FSO = CreateObject("Scripting.FileSystemObject")
    > Set SourceFolder = FSO.GetFolder(sFolderName)
    > Rw = Rw + 1
    > Cells(Rw, 1) = sFolderName
    > Cells(Rw, 1).Font.Bold = True
    > For Each FileItem In SourceFolder.Files
    > Application.StatusBar = SourceFolder & FileItem.Name
    > Rw = Rw + 1
    > Cells(Rw, 2) = FileItem.Name
    > Next FileItem
    > If SubDirs Then
    > For Each SubFolder In SourceFolder.SubFolders
    > Rw = Rw + 1
    > Call FilesInFolder(SubFolder.Path, Rw, True)
    > Next SubFolder
    > End If
    > Application.StatusBar = False
    > Columns("A:A").ColumnWidth = 2
    > Set FileItem = Nothing
    > Set SubFolder = Nothing
    > Set SourceFolder = Nothing
    > Set FSO = Nothing
    > End Sub
    >
    > Regards,
    > MP
    >
    > "Spammastergrand" <[email protected]> a écrit dans le message de
    > news:wTIRd.74061$QS5.47026@trndny06...
    > > Anyone know how to get at the object model of the favrites folder so I

    can
    > > back it up in Excel, Access Word, with VBA? Is it something like a
    > > filesystem object?
    > >
    > > What type of file is it anyway?
    > >
    > >

    >



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1