473,378 Members | 1,527 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Iterating folder of each mailbox in exchange store using CDO library

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
2 3320
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
I am facing the same issue.. did you find the solution?
Mar 23 '10 #3

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

Similar topics

0
by: Viorel | last post by:
How to gett a message from Exchange Server using WebDAV?
0
by: Michael Bray | last post by:
I'm considering writing an application for my company that looks at employees schedules and performs some scheduling operations that Outlook doesn't support natively (such as finding an available...
0
by: Anders K. Olsen | last post by:
Hello group Happy New Year to you all. I'm developing a Windows Service that needs to access the messages stored in a Public Folder in Microsoft Exchange. I have been looking into CDO 1.21,...
0
by: =?Utf-8?B?UGFkYW0=?= | last post by:
How to get different tooltip for each listitem in dropdownlist using C#. I am binding dropdownlist using database. Ofcourse each item in dropdownlist will be different. kindly do help me.
2
by: =?Utf-8?B?RGF2aWRF?= | last post by:
Hi, I try to connect to Exchange server using MAPI. I need to access a special user inbox and read all his new mails. The code I wrote work good, but I get my inbox instead of the user I need....
1
by: edcba | last post by:
Hello, I am required to write a C# app to connect to an exchange server using .Net 3.5. The aim will be then to receive emails and insert the email text into a database table. My first question...
0
by: santhosh309 | last post by:
Hi, How to retrive emails,attachments from exchange server using C#.NET?
1
by: santhosh309 | last post by:
How to download emails from exchange server using C#.net?
0
by: kottiPrasad | last post by:
Hello , I have mailboxes in the exchange server and i need to copy the mailboxes data from the exchange server and place it to the other exchange server using c#.Is it possible to access the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.