2016-02-06 24 views

回答

0

要从符合预定义条件的文件夹中检索所有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); 

您可能会发现下面的文章有帮助: