Reputation: 5104
If I want to know how many items in inbox, I use TotalCount Property, but how do I get inbox folder first? If I use FindFoldersResults findFolders=service.FindFolders() method, what is the parentfolder name for inbox? Thank you.
Upvotes: 4
Views: 1777
Reputation: 5422
Use
var folder = Folder.Bind(service, WellKnownFolderName.Inbox);
Upvotes: 9
Reputation: 5104
OK, I figured it out, hope the answer could help others.
SearchFilter searchFilter = new SearchFilter.IsEqualTo(FolderSchema.DisplayName, "inbox"); FindFoldersResults f = service.FindFolders(WellKnownFolderName.MsgFolderRoot,searchFilter,new FolderView(10));
The f is a folder array that conclude only one folder which is "Inbox" folder
Upvotes: 0