Hello
I am trying to read information from the GAL using C# .NET. I am able to return a list of all the addresses and names, however, when I walk through each address I cannot access the MAPI.AddressEntry.Fields(proptag) property. VS .NET will not allow the code to compile. I am looking to pull out more info than just the addresses and names. My environment consists of the following
CDO 1.2
Exchange 5.
Outlook 200
VS .NET 200
Here is the code
MAPI.SessionClass oSession = new MAPI.SessionClass()
oSession.Logon("OUTLOOK", System.Reflection.Missing.Value, true, true, System.Reflection.Missing.Value, false, System.Reflection.Missing.Value)
MAPI.AddressList oAddressList = (MAPI.AddressList) oSession.GetAddressList(MAPI.CdoAddressListTypes.C doAddressListGAL)
Console.WriteLine(oAddressList.Name)
MAPI.AddressEntries oAddressEntries = (MAPI.AddressEntries)oAddressList.AddressEntries
for(int j = 1; j <= (int)oAddressEntries.Count; j++
MAPI.AddressEntry oAddressEntry = (MAPI.AddressEntry)oAddressEntries.get_Item(j)
if(oAddressEntry.DisplayType.Equals(0) || oAddressEntry.DisplayType.Equals(6)
Console.WriteLine(" " + oAddressEntry.Name + " " + oAddressEntry.Fields)
If I try oAddressEntry.Fields(proptag) the code will not compile and will return this error
'MAPI.AddressEntry.Fields' denotes a 'property' where a 'method' was expecte
Any advice is greatly appreciated
Thanks
Mik