Outlook addin: Get elements from a selected calendar

。_饼干妹妹 提交于 2019-12-19 11:48:37

问题


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.

thank you,


回答1:


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

  1. Get a reference to the main calendar folder using

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

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

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



来源:https://stackoverflow.com/questions/7120681/outlook-addin-get-elements-from-a-selected-calendar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!