I use Exchange Web Services (EWS) from Microsoft.
My code is like this:
ExchangeService server = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
etc.
I get the folders using this code:
Folder rootfolder = Folder.Bind(server, WellKnownFolderName.MsgFolderRoot);
The structure of my folders on Exchange Server is:
Inbox
|
|
Folder1
|
|_Sub_Folder1
| |
| |_Sub_Sub_Folder1
| |
| |_Sub_Sub_Sub_Folder1
|
|_Sub_Folder2
| |
| |_Sub_Sub_Folder1
|
Folder2
|
|_Sub_Folder1
|
|_Sub_Folder2
When I use function which is presented above, I receive only the major folders :
Inbox
, Folder1
and Folder2
.
I would like to receive SubFolders
... as well and next I would like to get items from SubFolders
.
For Example:
Folder1
|
|_Sub_Folder1
| |
| |_Sub_Sub_Folder1
| |
| |_Sub_Sub_Sub_Folder1 -> I want to get these items
Could you help me and provide me an example of some code? What function should I use?
I tried to use:
FindFoldersResults findFoldersResults2 = folder.FindFolders(new FolderView(100));
But when I receive for example folders: Inbox
, Folder1
, Folder2
and I read ChildFolderCount
, I don't receive number of subfolders
ex. 2
-> I receive count 0
.
What is wrong? I need to read these items from subfolders
.