I found the following example to retrieve the contact list. But when execute the code, it give me GPF. An idea what is going wrong here?
Regards,
Fam
const
olFolderContacts = $0000000A;
var
outlook, NameSpace, Contacts, Contact: Variant;
i: Integer;
begin
outlook := CreateOleObject('Outlook.Application');
NameSpace := outlook.GetNameSpace('MAPI');
Contacts := NameSpace.GetDefaultFolder(olFolderContacts);
for i := 1 to 10 do
begin
Contact := Contacts.Items.Item(i);
{now you can read any property of contact. For example, full name and
email address}
ShowMessage(Contact.FullName + ' <' + Contact.Email1Address + '>');
end;
Outlook := UnAssigned;
end;