相关疑难解决方法(0)

.NET:获取所有Outlook日历项

如何从特定日历(特定日期)获取所有项目.让我们说比如每周一晚上我有一个带有重复项目的日历.当我请求所有这样的项目时:

CalendarItems = CalendarFolder.Items;
CalendarItems.IncludeRecurrences = true;
Run Code Online (Sandbox Code Playgroud)

我只买1件......

是否有一种简单的方法可以从日历中获取所有项目(主要项目+派生项目)?在我的具体情况下,可以设置一个日期限制,但只是为了获得所有项目(我的经常性项目本身是时间限制的)很酷.

我正在使用Microsoft Outlook 12对象库(Microsoft.Office.Interop.Outlook).

.net c# outlook calendar recurring

30
推荐指数
4
解决办法
7万
查看次数

Outlook筛选项 - 获取一周范围内的所有定期约会

我试图在周范围内获得所有约会,但重复出现的约会没有出现.

这是代码:

    var outlook = new Microsoft.Office.Interop.Outlook.Application();
    var calendar = outlook.Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar);
    calendar.Items.IncludeRecurrences = true;

    string filter = String.Format("[Start] >= {0} And [End] < {1}",
            DateTime.Now.Date.ToString("ddddd h:nn AMPM"),
            DateTime.Now.Date.AddDays(5).ToString("ddddd h:nn AMPM"));
    Outlook.AppointmentItem appointment;
    foreach (var item in calendar.Items.Restrict(filter))
    {
        appointment = item as Outlook.AppointmentItem;
        if (appointment != null)
        {
            MessageBox.Show(appointment.Start.ToString());
        }
    }
Run Code Online (Sandbox Code Playgroud)

如何获取Outlook中显示的所有定期约会一周?

c# office-interop outlook-2010

3
推荐指数
1
解决办法
5066
查看次数

标签 统计

c# ×2

.net ×1

calendar ×1

office-interop ×1

outlook ×1

outlook-2010 ×1

recurring ×1