Mike,
Have you tried:
oAddressEntry.Fields.get_Item(proptag)
The following site provides a number of resources on using Outlook with
..NET.
http://www.microeye.com/resources/res_outlookvsnet.htm
Hope this helps
Jay
"Mike" <(E-Mail Removed)> wrote in message
news:996D14BD-C28C-4578-AA4B-(E-Mail Removed)...
> 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.21
> Exchange 5.5
> Outlook 2002
> VS .NET 2003
>
> 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.CdoAddressListGAL);
> 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
expected
>
> Any advice is greatly appreciated.
>
> Thanks,
> Mike
>