Need some guidance

  • Thread starter Thread starter Byron
  • Start date Start date
B

Byron

I have added a new button to the menu in Outlook.
However, I really only want this new button to be in the
menu with the Contacts are displayed.

What do I need to do or how do I programatically have the
button to be visible only when the "Contacts" form is
being displayed?

Any help is appreciated.

Byron
 
You would need to use the Inspectors.NewInspector event to examine each new
Inspector window that appears and display or hide the button based on the
Class property of the Inspector.CurrentItem.
 
Sue,

Thanks for the reply.

Right now the button I have is visible on all menus in
Outlook. I only what it to be available on the Contacts
form.

Are the various forms refered to as Inwspectors? I do not
think that I have this down quite right.

Thanks for the help.

Byron
 
Inspector = the window that displays an individual item.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Sue,

I must just be dense on this one. How do I tell the
button to be available for the contacts and not for
anything else?

Byron
 
Each Inspector has a CurrentItem object representing the current item being
displayed. Each item has a Class property that tells you want kind of item
it is. (You can look up the possible values in the object browser.) If
Inspector.CurrentItem.Class <> olContact then you set the visible property
of your CommandBarButton to False. If it is olContact, you set Visible =
True.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top