Ready event in Microsoft Outlook 2010?

2019-08-31 11:37发布

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?

3条回答
甜甜的少女心
2楼-- · 2019-08-31 11:49

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

查看更多
ゆ 、 Hurt°
3楼-- · 2019-08-31 11:52

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).

查看更多
男人必须洒脱
4楼-- · 2019-08-31 11:57

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

查看更多
登录 后发表回答