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;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.