我正在使用VSTO开发Outlook的加载项。
当使用Send
(MeetingItem
)的AppointmentItem
方法时,如何禁用向所有参加者弹出的更新?当我打电话给现有会议的Send
时,它总是显示出来。
我只发现了ForceUpdateToAllAttendees
属性,但它会将更新发送给所有与会者,如果用户不想向所有与会者发送更新,那将是错误的。
编辑:
这是我的代码
void Application_ItemSend(object item, ref bool Cancel)
{
var form = new SC01(item);
form.Show();
Cancel = true; // prevent mail sending
}
......以SC01形式:
private void btn_OK_Click(object sender, EventArgs e)
{
var meetingItem = _item As MeetingItem; // _item is private field of SC01
meetingItem.GetAssociatedAppointment(false).Send(); // this Send() will make sending option (to update attendees only or to all attendees
}
对不起我好几天都不在。我想我有解决方案,虽然我只是“说”vba - 但最后它们都是一样的......
离开这条线:
Cancel = true; // prevent mail sending
还有一行:
meetingItem.GetAssociatedAppointment(false).Send();
据我所知,只要表格不再被隐藏,该项目将不会被发送。
我希望这有效!马克斯
只是有另一个想法应该解决你的问题:
void Application_ItemSend(object item, ref bool Cancel)
{
var form = new SC01(item);
form.Show();
'''next line is new and prevents the first popup
item.ForceUpdateToAllAttendees = TRUE
Cancel = true; // prevent mail sending
}
......以SC01形式:
private void btn_OK_Click(object sender, EventArgs e)
{
var meetingItem = _item As MeetingItem; // _item is private field of SC01
'''next line is new => popup Comes now
meetingItem.ForceUpdateToAllAttendees = FALSE
meetingItem.GetAssociatedAppointment(false).Send(); // this Send() will make sending option (to update attendees only or to all attendees
}