Outlook Filter Items - Get all recurring appointments in a week range

六月ゝ 毕业季﹏ 提交于 2019-11-30 23:58:33
user194076

You have to use recurrence pattern Put this inside your loop:

     if (item.IsRecurring)
        {
            Microsoft.Office.Interop.Outlook.RecurrencePattern rp = item.GetRecurrencePattern();
            DateTime first = new DateTime(2011, 11, 7, item.Start.Hour, item.Start.Minute, 0);
            DateTime last = new DateTime(2011, 12, 1);
            Microsoft.Office.Interop.Outlook.AppointmentItem recur = null;



            for (DateTime cur = first; cur <= last; cur = cur.AddDays(1))
            {
                    recur = rp.GetOccurrence(cur);
                    Console.WriteLine(cur.ToLongDateString());
            }
        }

see this for more info

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