Outlook 提醒获取 AppointmentItem
Outlook reminder get AppointmentItem
有没有办法知道 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
属性 - 它将 return 相应的 AppointmentItem
、TaskItem
、MailItem
等。您将需要检查实际类型 and/or 将其转换为适当的对象。
有没有办法知道 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
属性 - 它将 return 相应的 AppointmentItem
、TaskItem
、MailItem
等。您将需要检查实际类型 and/or 将其转换为适当的对象。