Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Outlook address list through Delphi

Status
Not open for further replies.

FamWS

Programmer
Jul 17, 2002
28
0
0
MY
Hi,

I would like to know how to access Outlook address list through Delphi.

An example will be appreciated!

Regards,
Fam
 
No-one seems to have done it, so if you want to code it yourself you will find the format for the pab address file at
 
There are examples of working code on waiting to be found. Any Delphi guy should at least know that site ;-)

HTH
TonHu
 
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;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top