How do i obtain the conversation history folder from office365?
I am using EWS and wish to obtain the conversation history folder from Office365 Exchange Online.
It was possible to achieve it by the method of judging the folder with DisplayName by the acquisition of the child folder from the root folder.
However, the user can change the name to this folder.
Is there a method that judges from ExtendedProperty to solve this problem? Moreover, is there an another way?
-code sample-
Folder folder = Folder.Bind(this._exchange, WellKnownFolderName.Root);
//acquire the total number of cases including the subfolder.
FolderVi开发者_StackOverflow社区ew view = new FolderView(1);
view.Traversal = FolderTraversal.Deep;
FindFoldersResults result = folder.FindFolders(view);
//acquire All folders.
view.PageSize = result.TotalCount;
result = folder.FindFolders(view);
FindFoldersResults folders = folder.FindFolders(view);
foreach (var f in folders.Folders)
{
//I want to judge the history folder of the conversation here excluding the DisplayName property.
}
Please anyone provide a good idea ,samples. regards.
To check if folder contains items from some conversation you can use something like that:
var filter = new SearchFilter.IsEqualTo(EmailMessageSchema.ConversationId, convId);
var itemView = new ItemView();
foreach (var f in folders.Folders)
{
var findResult = f.FindItems(filter, itemView);
}
Filter should restrict find results only to items that has property ConversationId
equal to conversation you are interested in.
精彩评论