Outlook addin: Get elements from a selected calendar

前端 未结 1 1748
时光说笑
时光说笑 2021-01-17 04:10

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 \

相关标签:
1条回答
  • 2021-01-17 04:46

    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.

    0 讨论(0)
提交回复
热议问题