Ready event in Microsoft Outlook 2010?

ぐ巨炮叔叔 提交于 2020-02-07 07:47:50

问题


Is there an event in Microsoft Outlook 2010 which one can subscribe on, in order to known when Outlook has finished initializing and all components, folders etc. have been loaded?


回答1:


Not sure about VSTO but good ol' COM addins get the StartupComplete "event" (via IDTExtensibility2) for exactly that purpose.




回答2:


Ok, I found out what I needed to do...

...

private void ThisAddInStartup(object sender, EventArgs e)
{

    this.Application.Startup += ApplicationStartup;
    this.Application.ItemLoad += ApplicationItemLoad;

 }

 void ApplicationItemLoad(object Item)
 {
     //Do something   
 }

 private void ApplicationStartup()
 {
     //Do something
 }

...

http://msdn.microsoft.com/en-us/library/ff869298.aspx




回答3:


Not that I'm aware of. Usually, addins don't do anything that requires talking with many outlook objects till some triggering event happens (like opening a mail, or creating a new inspector) so THAT'S when you'd typically see some custom code hooked in.

In my addins, the code connected to startup does things like load up some config, and maybe connect to a DB (although even that I tend to do on demand vs once at startup).



来源:https://stackoverflow.com/questions/5829687/ready-event-in-microsoft-outlook-2010

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