问题描述
我想更改现有约会。为此,我通过以下方式搜索现有约会:
ohmyzsh
或:
Outlook.Items foundItems = outlookItems.Restrict(filter);
if (foundItems != null)
{
foreach (var item in foundItems)
{
if (item is Outlook.AppointmentItem)
{
Outlook.AppointmentItem aptItem = item as Outlook.AppointmentItem;
aptItem.Start = start;
}
}
}
无论如何,如果我想填充appoitnment.Start属性,它将遇到此异常:
我以为这是一次会议,所以我尝试了以下方法:
foundItem = outlookItems.Find(filter) as Outlook.AppointmentItem;
if (foundItem != null)
{foundItem.Start = start}
但是foundItem为null,也没有MeetingItem ...
有人有主意吗?
解决方法
好的,我找到了解决方法:
如果需要定期约会或开会,我可以通过recurrencePattern填充属性 StartTime 和 EndTime :
newRecurrencePatternForOutlook.StartTime = start;
newRecurrencePatternForOutlook.EndTime = end;
但是为什么AppointmentItem的Start和End属性不存在,我无法回答。
也许这会帮助某人