【问题标题】:How to restrict all outlook appointments (including recurring) by property value using C#如何使用 C# 按属性值限制所有 Outlook 约会(包括定期约会)
【发布时间】:2016-05-16 10:14:11
【问题描述】:

如何使用 C# 按属性值限制所有 Outlook 约会(包括定期约会)。我用 filter = "@SQL=(http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/TestName IS NOT NULL)" (其中 TestName - 属性名称)并设置 calendarItems.IncludeRecurrences = true;但我只得到简单的约会结果

【问题讨论】:

    标签: c# outlook outlook-addin


    【解决方案1】:

    要从满足预定义条件的文件夹中检索所有 Outlook 约会项目,您需要按升序排列 sort 并将 IncludeRecurrences 设置为 true。如果您在使用 Restrict 方法之前不这样做,您将不会赶上定期约会。

        item = resultItems.GetFirst();
        do
        {
           if (item != null)
           {
               if (item is Outlook._AppointmentItem)
               {
                   counter++;
                   appItem = item as Outlook._AppointmentItem;
                   strBuilder.AppendLine("#" + counter.ToString() +
                                         "\tStart: " + appItem.Start.ToString() +
                                         "\tSubject: " + appItem.Subject +
                                         "\tLocation: " + appItem.Location);
               }
               Marshal.ReleaseComObject(item);
               item = resultItems.GetNext();
           }
       }
       while (item != null);
    

    您可能会发现以下文章对您有所帮助:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多