
Signature
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
> Trying to set a commandbar when Outlook opens. Several references have
> suggested patching into the explorer.activate event, installing the
[quoted text clipped - 16 lines]
> RowIndex. Is there a way to guarantee my button loads after the other
> toolbar?
Thanks, Ken.
When I examine ActiveExplorer(), I find that one does exist. When I
tap into its .Activate event (using casting, since the event is
ambiguous with its .Activate() method), the event does not fire on
startup. I know I'm wired in correctly since my eventhandler will fire
if I change focus to another application or minimize the window, and
then switch back to the explorer. But to install my toolbar, I need an
event that fires automatically after the explorer loads.
I found a sample that uses SelectionChange to install toolbars, but it
seems to me that event is less efficient since it fires so often (and
since I only need to trap it the first time). Is it a characteristic
of VSTO 2005 that .Activate no longer runs after startup, or that
startup takes place after .Activate runs???
> There is no way at all to determine or control in what order addins are
> loaded. You have to live with that uncertainty.
[quoted text clipped - 35 lines]
> > RowIndex. Is there a way to guarantee my button loads after the other
> > toolbar?
Ken Slovak - [MVP - Outlook] - 20 Jun 2006 14:04 GMT
You will only get that first Activate event for Explorers added after
startup. So what you want to do is handle the first Activate for those and
something else for the initial Explorer. I usually just set things up when I
add the Explorer to an Explorers collection which lets me handle events from
any open Explorer discretely.
Some people use SelectionChange and set a Boolean flag that makes sure the
code runs only once, after that it just exits the event handler. You'd need
something like that for Activate as well, it fires every time the Explorer
is activated again (like after going back to Outlook from another
application).
You don't say what language you're using but if it's C# there's a nice
example of an Explorer wrapper that handles multiple Explorers at
http://www.outlookcode.com/codedetail.aspx?id=789. There's also a whole
section of VSTO code and information at
http://www.outlookcode.com/vsto/index.htm.

Signature
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
> Thanks, Ken.
>
[quoted text clipped - 11 lines]
> of VSTO 2005 that .Activate no longer runs after startup, or that
> startup takes place after .Activate runs???