exchange-server-2003

What DLL do I reference (and where can I get them) to access the Exchange 2003 CDO API in Visual Studio 2008


I am trying to create an application that will manipulate mail messages on Exchange 2003. My development environment is Windows XP with Visual Studio 2008. After reading the description of the various APIs, it seems like CDO is what I should use.

I've downloaded the Exchange 2003 SDK. The documentation has a lot of example programs, but I can't get any of them to compile. I know I need to add references to the correct .DLL(s). The reference documentation talks about CDOEX.DLL. I've gotten the DLL from an Exchange 2003 and referenced it in my project. (Following this link.) It does add a number of objects under the CDO namespace, but many of the ones referenced in the documentation are not present. (For example a couple samples use CDO.Person, which is (as far as I can tell) does not exist.

What I find particularly confusing is that the sample projects use CDO.Person, yet the class reference documentation in the SDK does not list that class as one of the classes belonging to the CDO namespace.

Can anyone please point me to what I need to reference or link to my project to access this and other related classes in the Exchange 2003 SDK?

Additionally, am I missing a portion of the big picture? Is CDO not the way to go? My application will have to access and change are number of messages in hundreds, if not thousands, of different user mailboxes in the Exchange server.


Solution

  • I think I have found the answer. The file needs to be registered with RegSvr32 first. I did not expect this behavior. If you do not run RegSvr32 then only a subset of the classes shows up in the project when the DLL is referenced. But, if you run RegSvr32 cdoex.dll on the file first and then reference it, then all of the classes show up.

    I have not confirmed correct behavior when it runs (that will have to wait until I have access to an Exchange 2003 server for testing), but it does look like it compiles correctly.