【问题标题】:How to search item in a Clutter folder using ews manage api c#如何使用 ews manage api c# 在 Clutter 文件夹中搜索项目
【发布时间】:2016-05-27 10:07:34
【问题描述】:

我可以使用 EWS 管理 api 使用过滤器搜索 收件箱 中的项目,如下所示。

static void SearchByUsingFastSearch(ExchangeService service)
        {
            // Return the first 10 items in this call.
            ItemView view = new ItemView(10);

            // Find all items where the body contains "move reports".
            string qstring = "Body:\"move reports\"";

            // Identify the item properties to return.
            view.PropertySet = new PropertySet(BasePropertySet.IdOnly,
                                                ItemSchema.Subject);

            // Send the request and get the results.          
            FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Inbox, qstring, view);
        }

同样,有没有办法在 Clutter 文件夹中查找项目?类似于

FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Clutter, qstring, view);

【问题讨论】:

    标签: c# office365 ews-managed-api


    【解决方案1】:

    Clutter 文件夹没有枚举器,因为它是最近在线为 office365 引入的,据说可以解决您的问题,您需要按名称查找文件夹,捕获 id(并将其保存到实例变量,供后续使用),然后在其中查找项目。

    例如

            ExtendedPropertyDefinition ClutterFolderEntryId = new ExtendedPropertyDefinition(new Guid("{23239608-685D-4732-9C55-4C95CB4E8E33}"), "ClutterFolderEntryId", MapiPropertyType.Binary);
            PropertySet iiips = new PropertySet();
            iiips.Add(ClutterFolderEntryId);
            String MailboxName = "jcool@domain.com";
            FolderId FolderRootId = new FolderId(WellKnownFolderName.Root, MailboxName);
            Folder FolderRoot = Folder.Bind(service, FolderRootId, iiips);
            Byte[] FolderIdVal = null;
            if (FolderRoot.TryGetProperty(ClutterFolderEntryId, out FolderIdVal))
            {
                AlternateId aiId = new AlternateId(IdFormat.HexEntryId, BitConverter.ToString(FolderIdVal).Replace("-", ""), MailboxName);
                AlternateId ConvertedId = (AlternateId)service.ConvertId(aiId, IdFormat.EwsId);
                Folder ClutterFolder = Folder.Bind(service, new FolderId(ConvertedId.UniqueId));
                Console.WriteLine("Unread Email in clutter  : " + ClutterFolder.UnreadCount);
            }
    

    来源:http://gsexdev.blogspot.com/2015/01/accessing-clutter-folder-in-ews-in.html

    @GlenScales

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-06-11
      • 1970-01-01
      • 2012-12-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-01
      相关资源
      最近更新 更多