C# 2.0 MAPI wrapper

C# 2.0 MAPI wrapper

Post by R29uem8gTm » Sat, 25 Feb 2006 09:07:26

Has anyone got 2.0 C# working with MAPI and CDO. I can get it to work
with VB but not C#. Here is a sample of VB code:

Imports MAPI
Imports MAPI.CdoDefaultFolderTypes
Dim CdoMessages As MAPI.Messages
Dim cdoSession As MAPI.Session
Dim CdoFolder As Folder
Dim CdoMessage As MAPI.Message

cdoSession = New MAPI.Session
cdoSession.Logon("bomcng", , False, True)
CdoFolder = cdoSession.GetDefaultFolder(CdoDefaultFolderInbox)
CdoMessages = CdoFolder.Messages

Does anyone have a working comparable code snippet for C#?

Larry Jones

C# 2.0 MAPI wrapper

Post by Sue Mosher » Sat, 25 Feb 2006 22:38:04

You're ahead of me. I have plenty of failures trying to use CDO 1.21 in VB.Net in VS 2005. Bottom line is that it's unsupported. Your mileage may vary.

If you want input on your C# approach, though, I'd suggest that you post the code that you've tried and point out what didn't seem to work.

Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers