Creating invisible folder - C# - CDO

  • Thread starter Thread starter Sathiya Priya R
  • Start date 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
 
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.
 
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.
 
Back
Top