开发者

EWS: How to get created folder?

开发者 https://www.devze.com 2023-03-27 15:07 出处:网络
For those well known folder we can use WellKnownFolderName.Inbox to get inbox folder, but for those created by users, how to set searchFilter to get them? I found that all user created folder has a co

For those well known folder we can use WellKnownFolderName.Inbox to get inbox folder, but for those created by users, how to set searchFilter to get them? I found that all user created folder has a common property that the FolderClass is null, but when I use SearchFilter searchFilter = new SearchFilter.IsEqua开发者_高级运维lTo(FolderSchema.FolderClass, null); error happens. It says "Either the OtherPropertyDefinition or the Value properties must be set." Any idea?


Use

var folders = service.FindFolders(WellKnownFolderName.MsgFolderRoot, 
    new SearchFilter.IsEqualTo(FolderSchema.DisplayName, "name"), 
    new FolderView(1));

This will return the first folder named "name".

0

精彩评论

暂无评论...
验证码 换一张
取 消