【问题标题】:Dealing with multiple calendars in outlook在 Outlook 中处理多个日历
【发布时间】:2011-11-13 14:27:16
【问题描述】:

我想在 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;

来自.NET: Get all Outlook calendar items。在这种情况下 CalendarFolder.Folders 是空的,有什么帮助吗?对于å用户(不知道日历的名称),我需要一个遍历所有日历的函数。

谢谢

【问题讨论】:

    标签: c#


    【解决方案1】:

    试试这个:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-04-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-07
      相关资源
      最近更新 更多