Thread: ActiveExplorer
View Single Post
  #3  
Old February 26th 09, 04:59 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default ActiveExplorer

Also take a look at the Application.Explorers.NewExplorer event.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Ken Slovak - [MVP - Outlook]" wrote in message
...
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.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"WLAN" wrote in message
...
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






Ads