Group:  Microsoft Outlook ยป microsoft.public.outlook.interop
Thread: C# 2.0 MAPI wrapper

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

C# 2.0 MAPI wrapper
Gonzo Net 24.02.2006 00: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

Re: C# 2.0 MAPI wrapper
"Sue Mosher [MVP-Outlook]" <suemvp[ at ]outlookcode.com> 24.02.2006 13: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
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Gonzo Net" <Gonzo Net[ at ]discussions.microsoft.com> wrote in message news:C0218A25-67F9-43F1-AF63-43AB53D031D2[ at ]microsoft.com...
[Quoted Text]
> 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
>

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net