ActiveExplorer

W

WLAN

Hi,

I have a query regarding ActiveExplorer() instance in Outlook 2003 & Outlook
2007.
We have a custom store and old client extension code written in C++. This
works fine for all Outlook versions.

These dlls creates custom store as well as custom menus in outlook menu
bars. All these code are written in client extensions module.

The code is simple - getting activeexplorer(), then getting commandbar and
addinf new menus and toolbar buttons. This works fine with single instance of
explorer. If we launch multiple versions of Outlook, menus in the outlook
menu bar is not coming. This is happening only in Outlook 2003.

get_activeexplorer() is called in init module of client extension and checks
whether menu is already added in outlook menu bar. But outlook always returns
first instance ActiveExplorer() eventhough if you launch 2nd instance of
Outlook.

IS there anyway to get active explorer for next outlook instance.? Do I need
to set any active window for outlook?

Thanks in Advance
 
K

Ken Slovak - [MVP - Outlook]

I'm a little confused. Only 1 instance of Outlook can run at a time. Do you
mean when you open additional Explorers this happens?

ActiveExplorer() is the Explorer whose window is currently active. You can
get the Explorers collection and check its Count property to see how many
Explorers are actually open. If you want to activate a specific Explorer you
can do so by calling the Activate() method.

What many of us do to handle multiple open Explorers (or Inspectors) is to
use a wrapper class that handles any events of an Explorer that we want to
handle. Each class is then stored in a collection/list of some type to keep
the references alive and provide separation among Explorers. Each class gets
a Key value that's used when creating CommandBar UI to append to the Tag
property. That provides a unique Tag property, necessary so that a button
click doesn't fire in all open Explorers but only in the targeted Explorer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top