By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,028 Members | 1,784 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,028 IT Pros & Developers. It's quick & easy.

Iterating folder of each mailbox in exchange store using CDO library

P: 4
I am able to access the exchange mail boxes of the mounted edb file using Active Directory Services such that i am retrieving the

names of the user's and than setting the mail box to the user.
Expand|Select|Wrap|Line Numbers
  1.  CDO.Message objMsg;
  2.  CDO.DropDirectory objDropDir = new CDO.DropDirectory();
  3.  CDO.IMessages objIMesgs;
  4.  
  5.  
  6.  DirectoryEntry de = srUser.GetDirectoryEntry();            // Where srUser = "anup"
  7.  
  8.  
  9.  if (de.Properties["sAMAccountName"].Value.ToString() == "anup")
  10.  {
  11.  
  12.                                     objMailBox = (CDOEXM.Mailbox)de.NativeObject;                              
  13.  
  14.                            objPerson.DataSource.Open(de.Path,
  15.                                  null,
  16.                               ADODB.ConnectModeEnum.adModeRead,
  17.                              ADODB.RecordCreateOptionsEnum.adFailIfNotExists,
  18.                               ADODB.RecordOpenOptionsEnum.adOpenSource,
  19.                              String.Empty,
  20.                             String.Empty
  21.                                                 );
  22.  
  23.                                     objCImailBox = (CDO.IMailbox)objPerson.GetInterface("IMailbox");
  24.  
  25.                                     MessageBox.Show(objCImailBox.RootFolder);
  26.  
  27. }
  28.  
The problem is like :

1) After setting the objCmailBox to objPerson i am unable to get the URL's for Inbox, Sent Items.... and other's except for the

RootFolder URL.

I am able to get the url only for the RootFolder ie (file://./backofficestorage/pcvita.com/MBX/anup/IPM_ROOT)

2) I need to iterate through each of the folder like inbox and sent items and their mails through IMessages and IMessage.

such that :
Expand|Select|Wrap|Line Numbers
  1.                         objIMesgs = objDropDir.GetMessages(objFolderClass.SourceURL);
  2.  
  3.                          foreach(msg in objMesgs)
  4.                           {
  5.                                     msg.SubjectName;
  6.                            }
  7.  


Kindly help me out as i am stuck here.....
Jul 17 '09 #1
Share this Question
Share on Google+
2 Replies


P: 4
Hi,

Here is my code :

objCImailBox = (CDO.IMailbox)objPerson.GetInterface("IMailbox");

MessageBox.Show(objCImailBox.RootFolder);

The problem is like :

1) After setting the objCmailBox to objPerson i am unable to get the URL's for Inbox, Sent Items.... and other's except for the RootFolder URL.

I am able to get the url only for the RootFolder ie (file://./backofficestorage/pcvita.com/MBX/anup/IPM_ROOT)

I am looking for help which will allow me to access each of the folder and Items using the file :// URL

But i am not getting the URL path of each folder of the mail box as the objCImailBox.Inbox returns empty string instead

of file://path of the inbox.

I am able to get the path of the root folder. But i am unable to get the other URL path's for the ofher folder ie

(Inbox...).

Kindly provide me some few steps of code which i can fetch the folder URL's and than access each of the folder using

CDO.IFolder interface and open the items.

Your help will really help me out from this problem.
Jul 17 '09 #2

P: 3
I am facing the same issue.. did you find the solution?
Mar 23 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.