Creating invisible folder - C# - CDO

  • Thread starter Sathiya Priya R
  • Start date
S

Sathiya Priya R

Hi,

I'm trying to create an invisible folder using CDO 1.21 library. But it
gives me the error "[Collaboration Data Objects -
[MAPI_E_LOGON_FAILED(80040111)]]" in the objSession.Logon line.

Here is my code...
Session objSession =(MAPI.Session) Microsoft.VisualBasic.
Interaction.CreateObject("MAPI.Session","" );

objSession.Logon("","" ,false, Missing.Value,Missing
..Value,Missing.Value,Missing.Value); //i think i'm wrong here, is it
possible to create a session for the default profile - without
explicitly specifying the profile name?

MAPI.Folder rootFolder =(MAPI.Folder )
((MAPI.Folder)objSession.Inbox).Parent;

MAPI.Folders objFolders = (MAPI.Folders) rootFolder.Folders ;

objFolders.Add("My Invisible Folder");

Thanks
Satya
 
K

Ken Slovak - [MVP - Outlook]

You can't create an invisible folder using CDO and CDO is not supported
anyway for .NET languages. You'd have to use Extended MAPI to create an
invisible folder.
 
K

Ken Slovak - [MVP - Outlook]

Not from C#. As I said, C# is not supported for CDO. You'd have to use C++
to work with Extended MAPI from the .NET framework.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top