1 2 unit Unit1; 3 4 interface 5 6 uses 7 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 8 Dialogs,ComObj, StdCtrls; 9 10 type 11 TForm1 = class(TForm) 12 Button1: TButton; 13 Memo1: TMemo; 14 procedure Button1Click(Sender: TObject); 15 private 16 { private declarations } 17 public 18 { public declarations } 19 end; 20 21 var 22 Form1: TForm1; 23 24 implementation 25 26 {$R *.dfm} 27 28 procedure TForm1.Button1Click(Sender: TObject); 29 var 30 Outlook, NameSpace : Variant; 31 vFolder: Variant; 32 i: Integer; 33 begin 34 Outlook := CreateOleObject('Outlook.Application'); 35 NameSpace := Outlook.GetNameSpace('MAPI'); 36 37 //10 is for accessing the Contacts list 38 vFolder:= NameSpace.GetDefaultFolder(10); 39 40 Memo1.Lines.Add('First Name LastName Email Address'); 41 42 for i:= 1 to vFOlder.items.count-1 do begin 43 Memo1.Lines.Add(vFOlder.items[i].FullName+', '+vFOlder.items[i].LastName+ 44 ', '+vFOlder.items[i].Email1Address); 45 end; 46 47 end; 48 end. 49