const
// Wert des Standard-Kontakte-Ordners in Outlook
OL_FOLDER_CONTACTS = $0000000A;
var
OutlApp, OutlNS, Folder, ItemColl, Contact: OleVariant;
i, Count: Integer;
begin
OutlApp := CreateOleObject('
Outlook.Application');
OutlNS := OutlApp.GetNameSpace('
MAPI');
Folder := OutlNS.GetDefaultFolder(OL_FOLDER_CONTACTS);
ItemColl := Folder.Items;
Count := ItemColl.Count;
for i:=1
to Count
do begin
Contact := ItemColl.Item(i);
try
Memo1.Lines.Add(Contact.FirstName);
except
Continue;
end;
// um Fehler wegzufangen, falls Kontakt eine Verteilerliste ist
Memo1.Lines.Add(Contact.LastName);
Memo1.Lines.Add(Contact.CompanyName);
Memo1.Lines.Add(Contact.BusinessTelephoneNumber);
Memo1.Lines.Add(Contact.Business2TelephoneNumber);
Memo1.Lines.Add(Contact.HomeTelephoneNumber);
Memo1.Lines.Add(Contact.Home2TelephoneNumber);
Memo1.Lines.Add(Contact.MobileTelephoneNumber);
Memo1.Lines.Add(Contact.Email1Address);
Memo1.Lines.Add(Contact.Email2Address);
end;
Contact := Unassigned;
ItemColl := Unassigned;
Folder := Unassigned;
OutlNS := Unassigned;
OutlApp := Unassigned;