我正在使用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
}
属性,但它会将更新发送给所有与会者,如果用户不想向所有与会者发送更新,则会出错。
编辑:
这是我的代码
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
}
... 在SC01表格中:
{{1}}
答案 0 :(得分:0)
离开这条线:
Cancel = true; // prevent mail sending
还有一行:
meetingItem.GetAssociatedAppointment(false).Send();
据我所知,只要表格没有再次隐藏,该项目就不会被发送。
我希望这有效! 最大
答案 1 :(得分:0)
只是有另一个想法可以解决你的问题:
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
}