473,383 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

CDO 1.21 AddressEntry.Fields

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

Nov 16 '05 #1
3 4313
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" <bi*****@hotmail.com> wrote in message
news:99**********************************@microsof t.com...
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.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 expected
Any advice is greatly appreciated.

Thanks,
Mike

Nov 16 '05 #2
Mike,
I was basing my example on your example. Your example used get_Item on
AddressEntries, hence my example used get_Item on Fields. Neither collection
has a get_Item method per se.

However! Both Fields & AddressEntries have an Item property. The point I am
trying to make is that Fields may not have an indexer, (the parametized Item
property) that is usable from C#, hence your need to use the get_Item method
directly. Also word of warning Fields.Item takes two parameters! The second
one is optional.

Remember that CDO is not supported under .NET, your mileage may vary, I find
using CDO from VB.NET to be very usable, I have not attempted from C# yet. I
am able to use the Item property from VB.NET on the Fields collection.

Hope this helps
Jay
"Mike" <bi*****@hotmail.com> wrote in message
news:73**********************************@microsof t.com...
Jay,

The get_Item method is not a member of the Fields object, at least its not an exposed member. I have explored the microeye site and cannot find
anything there.
Regards,
Mike

Nov 16 '05 #3
Jay

Thanks for your advice - I am new to using CDO and I may end up switching this over to VB .NET

Thanks
Mike
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tim Cowan | last post by:
Hi I am trying to create a CSV file with some fields in double quotes ("). I am not having any luck. This is what I want; "8684","COSTING","000010001","REG",X4,15.00, ,14,0,14,9,6 I am...
0
by: bill mahoney | last post by:
I have access 2k and I have 2 tables. One is a 7X6 table representing a month with zeroes padding the fields where no day exist. For example February 2003 0 0 0 0 0 0 1 2 3 4 5 6 7 ...
4
by: Melissa | last post by:
I have a frontend file named CustomerApp and backend file named CustomerData. CustomerApp is at C:\Customer Database and CustomerData is at S:\Customer Database. Could someone help me with the code...
5
by: Megan | last post by:
Hi everybody- I'm helping a friend with a music database. She has an old one and is creating a new one. She wants to compare records and fields in the old database with records and fields in the...
2
by: Darryl Kerkeslager | last post by:
As the subject above hopefully makes clear, I want to do several reports, "with lots of fields not otherwise in database". These reports also have variable-length text. I have defined the...
0
by: Proteus | last post by:
Hi, I'm using access 97 on windows 98. I have table with 162 fields in it. I need to withdraw this information in a (totals) query with 164 fields (162 "avg" fields and 2 "count" fields). When I...
3
by: Mike | last post by:
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...
5
by: Genboy | last post by:
My "VIS" Website, which is a C# site created in VS.NET, Framework 1.1, is no longer compiling for me via the command line. As I have done 600 times in the last year and a half, I can compile to...
482
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.