SPECIAL OFFER        Order and save right now!
20% off with the 729824315 dicscount code for Ultimate Pack and any another product for Delphi from Greatis Programming!

⤷ Get address book of MS Outlook

This example shows, how to get contacts list from address book of MS Outlook.
Don't forget add ComObj to uses chapter.

uses ComObj;
...
procedure TForm1.Button1Click(Sender: TObject);
var
  OutlookObj, ObjSpace, ObjFolder: Variant;
  i: Integer;
  Str: string;
begin
  OutlookObj:=CreateOleObject('Outlook.Application');
  ObjSpace:=OutlookObj.GetNameSpace('MAPI');
  ObjFolder:=ObjSpace.GetDefaultFolder(10);
  for i:=1 to ObjFolder.Items.Count do
  begin
    Str:='';
    Str:=ObjFolder.Items[i].CompanyAndFullName+' - '+
         ObjFolder.Items[i].Email1Address;
    Memo1.Lines.Add(Str);
  end;
  OutlookObj.Quit;
end;
More for developers
Databases for Amazon Associates
Amazon Categories
Amazon Nodes