Task Pane

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In Outlook 2003 I have some code that when a user right-clicks on a Contact a
new menu item is added. The problem is that when a user clicks on the
Contacts Navigation Pane it is also adding the new menu item and I don't want
it to. In VBA code how do I stop this from happening on the Navigation Pane?
 
There´s no way via the OOM. You´d have to hook into the window messages
instead and check which window gets the mouse click.

As I´m not a specialist in this I can tell you only what I can see with
a tool like Spy++: Not all areas you can see in Outlook are accessable.
You could distinguish the navigation pane and the main window, where the
contacts are listed, but in that main window you couldn´t see e.g. if
the user clicks on a contact directly or on a blank space.

That´s one reason for the usually given answer here that you can´t
handle reliably context menus.
 
You´ll need a tool like Spy++ that can show you the hierarchy of
windows. Knowing that you can use some Win32 APIs for searching the
window handles.

It´s a lot of code, which to write would be your part. I can only give
you a tipp what to look for.

E.g. with the APIs GetWindow and GetWindowText you can search for
Outlook´s top window by its caption. Once you have this handle you can
walk through the hierarchy with GetWindow using the constants GW_CHILD
and GW_HWNDNEXT.

A good English source for Win32 APIs is http://www.allapi.net/
 
Back
Top