Importing Outlook contact information

Add-in Express™ Support Service
That's what is more important than anything else

Importing Outlook contact information
 
Manuel Onate




Posts: 76
Joined: 2004-06-16
I want to import Outlook contact information on my application (an add-in for Word). I am using code similar to the one below:

OutlookApplication.Connect;
NameSpace := OutlookApplication.GetNamespace('MAPI');
NameSpace.Logon('', '', False, False);
Folder := NameSpace.GetDefaultFolder(olFolderContacts);
itms := Folder.Items;
n := itms.Count;
for i := 1 to itms.Count do begin
if Supports(itms.Item(i),ContactItem,Contact) then begin
ListBox1.Items.Add(' Company: '+Contact.CompanyName);
...
ListBox1.Items.Add(' Address: '+Contact.BusinessAddress);
ListBox1.Items.Add(' Street: '+Contact.BusinessAddressStreet);
ListBox1.Items.Add(' City: '+Contact.BusinessAddressCity);
ListBox1.Items.Add(' Zip: '+Contact.BusinessAddressPostalCode);
ListBox1.Items.Add(' Country: '+Contact.BusinessAddressCountry);
ListBox1.Items.Add(' State: '+Contact.BusinessAddressState);
end;
end;
NameSpace.Logoff;

Everything seems to work ok, except for the Addresses. The field BusinessAddress seems to contain just the Street and BusinessAddressCity, PostalCode, State and Country are empty.

Is this a bug of the Outlook2000.pas file that comes with Delphi 5? If that is the case, which unit could I use?
Posted 16 Jun, 2004 12:34:31 Top
Manuel Onate




Posts: 76
Joined: 2004-06-16
I forgot to say that the same happens with HomeAddress and MailingAddress.
Posted 16 Jun, 2004 12:37:24 Top
Dmitry Kostochko


Add-in Express team


Posts: 2731
Joined: 2004-04-05
We have just tested the code you show above. Everything works well. What Outlook version do you use?

Sincerely,
ADX Support Team
Posted 17 Jun, 2004 04:03:38 Top
Guest


Guest


Outlook 2000.
Posted 17 Jun, 2004 14:35:02 Top
Dmitry Kostochko


Add-in Express team


Posts: 2731
Joined: 2004-04-05
Yesterday our test PC with Outlook 2000 was down. Today we have tested it with Outlook 2000 and again everything works well. So I would suggest writing me by email and we will continue.

Sincerely,
ADX Support Team
Posted 18 Jun, 2004 04:03:54 Top