2016-02-06 25 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); 

您可能會發現下面的文章有幫助: