2011-09-09 7 views
1

Outlook에서 모든 캘린더의 모든 항목을 추출하고 싶습니다. 내 기본 캘린더로 작업하고 있지만 일부 알 수없는 이유로 다른 캘린더 항목을 가져올 수 없습니다. 여기까지 내가 지금까지 한 것은 다음과 같습니다.Outlook에서 여러 캘린더 다루기

   Microsoft.Office.Interop.Outlook.Application oApp = null; 
       Microsoft.Office.Interop.Outlook.NameSpace mapiNamespace = null; 
       Microsoft.Office.Interop.Outlook.MAPIFolder CalendarFolder = null; 
       Microsoft.Office.Interop.Outlook.Items outlookCalendarItems = null; 

       oApp = new Microsoft.Office.Interop.Outlook.Application(); 
       mapiNamespace = oApp.GetNamespace("MAPI"); ; 
       CalendarFolder = mapiNamespace.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderCalendar); outlookCalendarItems = CalendarFolder.Items; 
       outlookCalendarItems.IncludeRecurrences = true; 

It 's from .NET: Get all Outlook calendar items입니다. 이 경우 CalendarFolder.Folders는 비어 있습니다. 캘린더의 이름을 알지 못하는 사용자를 위해 모든 캘린더를 반복하는 함수가 필요합니다.

감사

답변

0

이 시도 :

Application outlook = new Application(); 
MAPIFolder calendars = (MAPIFolder)outlook.ActiveExplorer().Session.GetDefaultFolder(OlDefaultFolders.olFolderCalendar); 
      for (int i = 1; i <= calendars.Folders.Count; i++)