Need some guidance

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
 
S

Sue Mosher [MVP-Outlook]

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.
 
B

Byron

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
 
S

Sue Mosher [MVP-Outlook]

Inspector = the window that displays an individual item.

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

Byron

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
 
S

Sue Mosher [MVP-Outlook]

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
 

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