EWS API : In-Place Archive Folder Item Count Issue.
Hi everyone,
I’m working on a C# application using the Exchange Web Services API to retrieve the email count from In-Place Archive folders, including nested ones.
Here’s the code I’m using to get folder Item Count:
Microsoft.Exchange.WebServices.Data.Folder ParentFolder = Folder.Bind(service, FolderName).Result;
Microsoft.Exchange.WebServices.Data.SearchFilter.SearchFilterCollection FilterCollection = new SearchFilter.SearchFilterCollection(LogicalOperator.Or);
FindFoldersResults FoldersResults = ParentFolder.FindFolders(FilterCollection, objFoldView).Result;
Issue: The API response successfully retrieves the folders (no errors or exceptions), but the ItemCount
property always returns 0
. Even when attempting to retrieve emails directly using the folder ID, the result is still empty.
However, when I check the user's In-Place Archive folder and nested folders manually, emails are present.
Has anyone encountered this issue before, or is there a workaround to retrieve the correct item counts for archive folders?
Thanks,
Ritu Yadav