首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Outlook提醒获取AppointmentItem

Outlook提醒获取AppointmentItem
EN

Stack Overflow用户
提问于 2015-06-19 16:23:50
回答 1查看 840关注 0票数 1

有什么方法可以知道Outlook.reminder是否为AppointmentItem所拥有?我有一个eventHandler,当一个提醒被触发时,它就会被触发。在这种情况下,我想知道哪一个Outlook项目拥有提醒,以及它是否是一个AppointmentItem (如果它适合其他规则来取消提醒)。

代码语言:javascript
复制
 storage._Explorers = this.Application.Explorers;
 storage._Explorers.Application.Reminders.ReminderFire += new Outlook.ReminderCollectionEvents_ReminderFireEventHandler(Application_ReminderFire);

..。

代码语言:javascript
复制
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);
                    }
                }
            }
        }
    }
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-06-19 16:52:35

使用Reminder.Item属性-它将返回相应的AppointmentItemTaskItemMailItem等。您将需要检查实际类型和/或将其转换为适当的对象。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30942888

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档