我使用的是 12.0 Interop 库,它是 Outlook 2007 的默认设置。我实际上的目标是将 Outlook 2003 到 2010 与注册到 退出 事件的代码示例集成。
即使 docs假设 Outlook 应用程序有一个应用程序 Quit event,我在 Outlook.Application
对象实现中找不到它。
Visual Studio 2010 似乎将 Quit
识别为一种方法:
问题:
如何注册到 Outlook 应用程序的退出事件? (如果在应用程序退出时触发了一个或任何事件)如果可能,请提供一些示例代码。
谢谢!
最佳答案
((Outlook.ApplicationEvents_11_Event)Application).Quit
+= new Outlook.ApplicationEvents_11_QuitEventHandler(ThisAddIn_Quit);
void ThisAddIn_Quit()
{
System.Windows.Forms.MessageBox.Show("bye bye problem, I found the solution!!");
}
关于c# - Outlook 中没有应用程序退出事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6677349/