unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,ComObj, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
Outlook, NameSpace : Variant;
vFolder: Variant;
i: Integer;
begin
Outlook := CreateOleObject('Outlook.Application');
NameSpace := Outlook.GetNameSpace('MAPI');
//10 is for accessing the Contacts list
vFolder:= NameSpace.GetDefaultFolder(10);
Memo1.Lines.Add('First Name LastName Email Address');
for i:= 1 to vFOlder.items.count-1 do begin
Memo1.Lines.Add(vFOlder.items[i].FullName+', '+vFOlder.items[i].LastName+
', '+vFOlder.items[i].Email1Address);
end;
end;
end.