Customize right button menu

  • Thread starter Thread starter Roberto García
  • Start date Start date
R

Roberto García

Hello,

I'm new to the developing add ins for outlook and I need some information
about the viability of some points. Here they are:

I would like to know if it's posible to disable some elements of the right
button menu such as Open and Delete when clicking an appoinment in the
calendar.
I need to know also, if it's posible, when the user doble clicks an
appoinment, to launch an application instead of opening the edit window for
the appoinment.

Is there any kind of documentation where I can find some information about
this stuff?
I will thank any suggestion

Cheers!
 
Version of Outlook?

Handling context menus is built-in with Outlook 2007, for earlier versions
you have to use a hack shown at www.outlookcode.com to handle the
Explorer.CommandBars_OnUpdate() event. For Outlook 2007 you use whichever of
the Application context menu events that handle what you want.

You can then get the specific CommandBarButton object you want to disable
and set its Enabled property to false.

When an item is opened it fires the Inspectors.NewInspector event. So if you
handle that event you know when something is being opened. That event passes
you the Inspector to be opened and you can check for
Inspector.CurrentItem.Class to see if it's an item type you want to handle,
for example if the Class is olMail then it's a mail item.

You cannot cancel the opening of the Inspector but you can start a program
appropriately at that point. If you don't want the Inspector window there
you would have to handle Inspector events and close the Inspector on its
first Activate event. That will however cause a flash on the screen as the
Inspector window is opened and closed.

It's impossible to provide any sample code since you didn't mention your
Outlook version or the language you intend to use. You can find lots of
Outlook code samples in various languages and for various versions at
www.outlookcode.com.
 
Hello again,

Thank you so much for your answer.

The version of Outlook I'm using is 2003.
I haven´t found yet the hack you mentioned. Would you mind to specify its
location?

Thank you

Cheers!
 
Sorry, I forgot to ask if your explanation about opening other application
can be applied to Outlook 2003.
Is the new inspector event similar to the open event of an appointment? i
need it only to be fired with this especific item and send to that
application one of the parameters of the appointment.

Thanks.
 
NewInspector fires before the Open event for an item. That's how you know an
item is about to be opened. You can start another application using code no
matter which version of Outlook you're using.
 
There are lots of examples of doing that at outlookcode.com, just search on
"context menu" and start looking at the results.
 
Back
Top