gpt4 book ai didi

c# - Outlook 中没有应用程序退出事件?

转载 作者:太空狗 更新时间:2023-10-29 20:45:22 26 4
gpt4 key购买 nike

我使用的是 12.0 Interop 库,它是 Outlook 2007 的默认设置。我实际上的目标是将 Outlook 2003 到 2010 与注册到 退出 事件的代码示例集成。

即使 docs假设 Outlook 应用程序有一个应用程序 Quit event,我在 Outlook.Application 对象实现中找不到它。

Visual Studio 2010 似乎将 Quit 识别为一种方法:

Quit seems to be a method, not an event

问题:

如何注册到 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com