No Application Quit event in Outlook?

一世执手 提交于 2019-12-30 09:05:33

问题


I'm using the 12.0 Interop library, which is the default for Outlook 2007. I'm actually aiming for Outlook 2003 to 2010 integration with a code example that registers to a quit event.

Even though the docs say that there is an application Quit event for the Outlook app, I can't find it in the Outlook.Application object implementation.

Visual Studio 2010 seems to identify Quit as a method:

Question:

How would one register to the Outlook application's Quit event? (if there is one, or any event that is triggered when the application quits) If possible provide some example code.

Thanks!


回答1:


Just try to give a solution: may be you can get Outlook process and listen for Process.Exited event.




回答2:


((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!!");
}


来源:https://stackoverflow.com/questions/6677349/no-application-quit-event-in-outlook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!