Solved

Importing & Exporting bookmarks from IE, Opera, Netscape

Posted on 2003-11-07
5
508 Views
Last Modified: 2010-04-05
I need the code for importing & exporting the bookmarks from/To Internet Explorer, Opera and NetScape.
The imported bookmarks should be read in a record like this:


TDatabase=record
          Category:String;                
          Files: array[1..200] of TFiles;

TFiles=record
               Title:string;
               URL:String;
               Description:String;
          end;

Also the categories i want to be included into treview (inserted into curent node).


ex:
 if the bookmarks from internet are:
             Business // -category
                  url1   desctription <--- if any
                  url2   desctription <--- if any
                  ....
            
            Fun // -category
                  url1   desctription <--- if any
                  url2   desctription <--- if any
                  ....
            
to be read like this:
      category[i]:=business;
      category[i].Files[1].Title:=Title of the url
      category[i].Files[1].Url:= url1
      category[i].Files[1].Description:= DEscription  of url1
      
      Category[i].Files[2].Title:=Title of the url
      category[i].Files[2].Url:= url1
      category[i].Files[2].Description:= DEscription  of url1

      ........
      
      category[i]:=Fun;
      category[i].Files[1].Title:=Title of the url
      category[i].Files[1].Url:= url1
      category[i].Files[1].Description:= DEscription  of url1

      Category[i].Files[2].Title:=Title of the url
      category[i].Files[2].Url:= url1
      category[i].Files[2].Description:= DEscription  of url1
      .........
0
Comment
Question by:so3
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 3

Expert Comment

by:fibdev
ID: 9705702
IE Favorites are stored in a directory...

Use this key to find the favorites directory of the current user...

add "Registry" to your uses list.

I was working on this, but I'm too tired to contiue.  maybe someone else can get it working...

unit Unit1;

interface

uses
  Windows, Messages, Registry, FileCtrl
,SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    ListBox1: TListBox;
    Button1: TButton;
    function GetFavorites(): TStrings;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
function TForm1.GetFavorites(): TStrings;
var Favorites : TStrings ;
    FavDir : String;
    Reg : TRegistry;
    Rec : TSearchRec;
begin
    Reg := TRegistry.Create;
    reg.RootKey := HKEY_CURRENT_USER;
    if not reg.KeyExists('\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders')
       then ShowMessage('Could not locate IE Favorites')
    else
    Reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders', False);
    FavDir := Reg.ReadString('Favorites');
    try
    if FavDir[Length(FavDir)] <> '\' then FavDir:= FavDir + '\';
    if FindFirst(FavDir+'*.*', faAnyFile, Rec) = 0 then
       repeat
        if (rec.attr and faDirectory > 0)and(rec.name <> '.')and(rec.name <> '..') then
         //GetFavorites(FavDir+rec.name+'\')
       else
       Favorites.Add(rec.Name);
  until FindNext(Rec) <> 0;
  FindClose(Rec);
  result := Favorites;
  finally
   reg.Free;
  end;
  end;
procedure TForm1.Button1Click(Sender: TObject);
begin
        listbox1.Items.AddStrings(GetFavorites);
end;

end.
0
 
LVL 6

Author Comment

by:so3
ID: 9708285
tnx for the code fibdev.
and for opera & netscape do you know how?
0
 
LVL 3

Accepted Solution

by:
fibdev earned 50 total points
ID: 9708453
It was late when I started that and I never did get that function working.  I think it's a step in the right direction, but it needs work.

here is a link for a vcl that will do exactly what you are after.  they want $15 for it though...

http://www.delphipages.com/edit/count.cfm?ID=1430
0
 
LVL 6

Author Comment

by:so3
ID: 9711124
with the code above i succeded to get the favorites in my list but now i don't know how to proceed with the bookmarks from Opera & NetScape
0
 
LVL 6

Author Comment

by:so3
ID: 9760257
Does anyone know how to import/export bookmarks from opera & Netscape or if there are any free components for doing this?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question