View Single Post
  #1  
Old July 23rd 09, 05:14 AM posted to microsoft.public.outlook.program_vba
converting GAL entries to contacts[_2_]
external usenet poster
 
Posts: 3
Default Problem while converting GAL entries to contacts in Outlook Cont

Hi,

I am retrieving the GAL contcts of outlook using the following code snippet
and converting them into contacts to retrieve the email address of that
particular GAL entry.
Here I am using Outlook 2007 dll.

OutLook.

Application app = new Microsoft.Office.Interop.Outlook. Application ();



AddressEntries addressEntries = app.Session.AddressLists[ "Global Address
List" ].AddressEntries;



for ( int a = 1; a = addressEntries.Count; a++)

{

OutLook.

ContactItem contact = ( ContactItem )addressEntries[a].GetContact();



string email = contact.Email1Address;

}

when I try to convert each address entry of Global Address List(GAL) into a
contact, it is not converting EmailAddreess value of that GAL entry ,instead
it is converting to a null value eventhough email address exists for that GAL
entry.

How to get email address property value when converting a GAL entry into a
contact?
Here I am using outlook 2007 Object Model dll.

So, anyone please help me how can I solve the above requirement through the
sample code snippet.
Ads