我想更改现有约会。为此,我通过以下方式搜索现有约会:
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;
}
}
}
或者:
foundItem = outlookItems.Find(filter) as Outlook.AppointmentItem;
if (foundItem != null)
{foundItem.Start = start}
无论如何,如果我想填写 appoitnment.Start 属性,它会遇到这个异常:
“该对象不支持此方法。”
我的想法是这是一个会议,所以我尝试了以下方法:
Outlook.MeetingItem foundItem = outlookItems.Find(filter) as Outlook.MeetingItem;
Outlook.AppointmentItem aptItem = foundItem.GetAssociatedAppointment(false);
但是foundItem为空,也没有MeetingItem ...
有人有想法吗?