我需要我的插件来检测何时删除定期会议。我的问题是如果我只删除集合中的一个出现或者我删除整个集合,则以相同的方式触发BeforeDelete事件。我需要知道用户何时删除整个集合而不仅仅是单个事件。 Item中是否有一个变量可以引用它?
public void MailItem_BeforeDelete(object Item, ref bool Cancel) {
Outlook.AppointmentItem MailItem = Item as Outlook.AppointmentItem;
//Somewhere in this little guy [MailItem] should be something telling me if the
//item that is being deleted is a single occurance or is the entire set that is being deleted?
//MailItem.IsRecurring is true in both instances so thats doesnt work.
}
答案 0 :(得分:1)
使用RecurrenceState
属性。
从文档中,此属性设置为OlRecurrenceState
枚举:
以下是文档的几个链接:
https://msdn.microsoft.com/VBA/Outlook-VBA/articles/appointmentitem-recurrencestate-property-outlook
https://msdn.microsoft.com/VBA/Outlook-VBA/articles/olrecurrencestate-enumeration-outlook