Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Export From Bookmarks To Excel

Does anyone know of a program where I can export bookmarks categories,
subcategories, and URLs into corresponding columns in Excel? I found
a really great one called bookmark buddy, but it gives me a lot of
superfluous info that makes it hard to sort. I just need those three
thrings, so maybe a program that let's the user specify which info to
export?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Export From Bookmarks To Excel

If you're speaking of IE Bookmarks, try code like the following. You'll
need to set a reference in VBA to the "Microsoft Scripting Runtime Library"
(from the References item on the Tools menu in VBA).

Sub ListBookmarks()

Dim FSO As Scripting.FileSystemObject
Dim FolderName As String
Dim Dest As Range
Dim TopFolder As Scripting.Folder
Dim OneFile As Scripting.File
Dim TStream As Scripting.TextStream
Dim S As String
Dim Pos1 As Long
Dim Pos2 As Long
Dim URL As String

Set Dest = Worksheets("Sheet1").Range("A2")

FolderName = Environ("HOMEDRIVE") & Environ("HOMEPATH") & "\Favorites"
Set FSO = New Scripting.FileSystemObject

Set TopFolder = FSO.GetFolder(FolderName)

For Each OneFile In TopFolder.Files
Set TStream = OneFile.OpenAsTextStream(ForReading)
S = TStream.ReadAll()
Pos1 = InStr(1, S, "URL=", vbTextCompare)
If Pos1 Then
Pos2 = InStr(Pos1 + 1, S, vbNewLine, vbBinaryCompare)
If Pos2 Then
URL = Mid(S, Pos1 + 4, Pos2 - Pos1 - 4)
Dest(1, 1) = TopFolder.Name
Dest(1, 2) = OneFile.Name
Dest(1, 3) = URL
Set Dest = Dest(2, 1)
End If
End If
TStream.Close
Next OneFile

DoOneFolder FSO:=FSO, WhatFolder:=TopFolder, Dest:=Dest


End Sub

Sub DoOneFolder(FSO As Scripting.FileSystemObject, WhatFolder As
Scripting.Folder, Dest As Range)

Dim OneFile As Scripting.File
Dim OneFolder As Scripting.Folder
Dim TStream As Scripting.TextStream
Dim S As String
Dim Pos1 As Long
Dim Pos2 As Long
Dim URL As String

For Each OneFile In WhatFolder.Files
Set TStream = OneFile.OpenAsTextStream(ForReading)
S = TStream.ReadAll()
Pos1 = InStr(1, S, "URL=", vbTextCompare)
If Pos1 Then
Pos2 = InStr(Pos1 + 1, S, vbNewLine, vbBinaryCompare)
If Pos2 Then
URL = Mid(S, Pos1 + 4, Pos2 - Pos1 - 4)
Dest(1, 1) = WhatFolder.Name
Dest(1, 2) = OneFile.Name
Dest(1, 3) = URL
Set Dest = Dest(2, 1)
End If
End If
TStream.Close
Next OneFile

For Each OneFolder In WhatFolder.SubFolders
DoOneFolder FSO:=FSO, WhatFolder:=OneFolder, Dest:=Dest
Next OneFolder

End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"SJ Carter" wrote in message
ps.com...
Does anyone know of a program where I can export bookmarks categories,
subcategories, and URLs into corresponding columns in Excel? I found
a really great one called bookmark buddy, but it gives me a lot of
superfluous info that makes it hard to sort. I just need those three
thrings, so maybe a program that let's the user specify which info to
export?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bookmarks in Excel??? Phil Excel Worksheet Functions 4 February 13th 12 10:03 AM
Excel and Word Bookmarks JFamilo[_7_] Excel Programming 1 July 14th 05 05:13 AM
Add bookmarks to an abobe doc from excel? svetlana Excel Programming 0 May 6th 05 04:11 PM
VBA, Bookmarks, Word and Excel... help please! [email protected] Excel Programming 2 February 13th 05 09:03 PM
Creating Excel bookmarks Louise Excel Worksheet Functions 1 January 21st 05 06:54 PM


All times are GMT +1. The time now is 07:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"