Outlook 插件:从选定的日历中获取元素 [英] Outlook addin: Get elements from a selected calendar

查看:31
本文介绍了Outlook 插件:从选定的日历中获取元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建 Outlook 加载项,我想知道如何从选定的日历中获取元素?例如,我需要从名为myCalendar"的日历中获取所有约会项目.现在,我可以从所有日历中获取所有约会项目.

I'm creating an Outlook add-in and i'd like to know how to get elements from a selected calendar? For exemple, i need to get all Appointments items from a calendar named "myCalendar". Now, i can just get all appointments items from ALL calendars.

谢谢,

推荐答案

那些额外的日历可用作主日历文件夹的子文件夹.所以这就是你要做的:

Those extra Calendars are available as subfolders of the main Calendar folder. So here is what you do:

  1. 使用

Outlook.MAPIFolder 日历 = Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar);

Outlook.MAPIFolder calendar = Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar);

枚举 calendar.Folders 集合,直到找到具有您要查找的 MAPIFolder.Name 的集合.

Enumerate the calendar.Folders collection until you find one with the MAPIFolder.Name you are looking for.

从该 MAPIFolder 中,将所有 Items 枚举为 Outlook.AppointmentItem,就像您已经在做的那样.

From that MAPIFolder, enumerate all Items as Outlook.AppointmentItem like you are already doing.

这篇关于Outlook 插件:从选定的日历中获取元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆