[英]Event when user clicks to close message window
有没有办法知道用户何时单击以关闭消息窗口,以及在 “您要保存更改”对话框出现之前? 我已经注册了Inspector.Close事件,但是只有在用户决定保存/放弃更改后才会触发: ((InspectorEvents_10_Event)Inspector).Close += OnInspectorClose;
好的,因此显然我需要使用邮件项目中的事件,而不是检查器中的事件。 我需要在里面注册处理程序。 NewInspector处理程序:
if (inspector.CurrentItem is MailItem)
{
MailItem item = inspector.CurrentItem as MailItem;
((ItemEvents_10_Event)item).Close += OnItemClose;
}
然后准备处理程序:
private void OnItemClose(ref bool cancel) //ItemEvents_10_CloseEventHandler
{
((ItemEvents_10_Event)_lastOpenedItem).Close -= OnItemClose;
_lastOpenedItem.Close(OlInspectorClose.olDiscard);
}
并且此OnItemClose将在检查器的Close事件触发之前执行( ((InspectorEvents_10_Event)Inspector).Close
)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.