有没有办法知道Outlook.reminder是否由AppointmentItem拥有?我有一个eventHandler,当提醒被触发时会被触发。在这种情况下,我想知道哪个Outlook项目拥有该提醒,如果它适合其他规则以消除该提醒,则它是否为AppointmentItem。
storage._Explorers = this.Application.Explorers;
storage._Explorers.Application.Reminders.ReminderFire += new Outlook.ReminderCollectionEvents_ReminderFireEventHandler(Application_ReminderFire);
...
static void Application_ReminderFire(Outlook.Reminder reminder) {
object item = reminder.Parent;
if (item is Outlook.AppointmentItem) {
AppointmentItem appointment = (item as AppointmentItem);
MAPIFolder folder = appointment.Parent;
StringCollection collection = Properties.Settings.Default.CALENDARS_SETTINGS;
foreach (string chaine in collection) {
string[] values = chaine.Split(new string[] { "," }, StringSplitOptions.None);
if (folder.Name == values[0]) {
Boolean reminderChecked = Boolean.Parse(values[1]);
if (!reminderChecked) {
MessageBox.Show(reminder.Caption, "DISMISS", MessageBoxButtons.OK);
}
}
}
}
}
使用Reminder.Item
属性-它会返回相应的AppointmentItem
,TaskItem
,MailItem
等你将需要检查的实际类型和/或将其转换为合适的对象。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句