如何使用folderId查找邮箱的文件夹路径?

时间:2015-11-03 13:34:16

标签: exchange-server exchangewebservices exchange-server-2010 ews-managed-api

我有邮箱中文件夹的folderId属性。如何使用EWS找到文件夹的完整路径?

1 个答案:

答案 0 :(得分:3)

您可以使用应包含完整路径的PR_FOLDER_PATHNAME扩展属性。示例:

ExtendedPropertyDefinition FolderPath = new ExtendedPropertyDefinition(0x66B5, MapiPropertyType.String);
PropertySet psset1 = new PropertySet(BasePropertySet.FirstClassProperties);
psset1.Add(FolderPath);

Folder FolderwithPath = Folder.Bind(service, WellKnownFolderName.Inbox, psset1);
Object FolderPathVal = null;
if (FolderwithPath.TryGetProperty(FolderPath,out  FolderPathVal))
{
    Console.WriteLine(FolderPathVal);
}