Catch events from pre-existing buttons in Outlook 2007

S

Stephan Steiner

Is there a way I can reroute events thrown when standard buttons are being
pushed in Outlook 2007? Specifically, I'd like to replace the entire call
functionality (like OCS does.. normally all calling functionality is bound to
TAPI but when MOC is installed, everything goes to OCS. The PBX I work with
offers different means than TAPI so I need to integrate this somehow. I
managed to almost entirely duplicate the call menus, but it would be much
nicer to just go ahead and do it the way it's done with Office Communicator
without having to bother with commandbars, popup events and ribbons.

There are 3 buttons I need to hook into: The Dropdown button in the Contacts
view, the right click menu on each contact, and the Communication Ribbon when
editing a contact.
 
K

Ken Slovak - [MVP - Outlook]

Get the buttons as CommandBarButton objects and in the click event handlers
do what you want. Then if you want to cancel the default operations set
CancelDefault to true.
 
S

Stephan Steiner

Thanks for the hint.. I managed to override the standard call split button so
far and am currently working on the right click menus.

One thing though.. is there a universal way to get the right control
regardless of the locale of Office? I'm on an English Office but most of my
customers will be using German or French versions - so looking for &Call (to
get the call split button) seems rather futile. Can I trust the Id of the
button (2621 for the call button)? And what about the poups? There each
control has the same ID (32768).. so how do you differentiate between the
different items in the popup menu?

Regards
Stephan
 
K

Ken Slovak - [MVP - Outlook]

The id numbers are universal, even if the names aren't.

I usually get the command id's using a MAPI viewer tool called OutlookSpy
(www.dimastr.com). It lets you view the CommandBars collections for
Inspectors and Explorers and from there you can see the id's.

For ribbon controls I want to repurpose I use the idMso for the ribbon
control I want, gotten from the ribbon schema downloads and set up the
callback for that control using the ribbon XML.

For context menus I use the Outlook 2007 additions to the object model for
handling the various context menus.

I'm not sure which controls you are referring to in your post.
 
S

Stephan Steiner

Ken

I must be doing something wrong.. I managed to repurpose certain buttons in
the contacts, but no luck with the call menu. The split button I'm refering
to is called "Call", has a telephone handset as icon, and is in the
Communicate section of the Contact. In the same section we have the E-Mail,
Meeting, ASsign Task, WebPage and Map fuctionality by default.

When clicked the button shows a list of all telephone numbers, including
their label, and clicking one will initiate a call using whatever TAPI TSP
has bee configured (or when you use Microsoft Office Communicator, the
communicator starts dialing).

Finding the idMso isn't easy for outlook as there 19 different files, and
their names don't necessary match what you expect. E.g. there's no
OutlookContactItemRibbonControls.xlsx (that's where I'd expect the contact
ribbon to be explained). However, I think I still found it -
outlookTaskItemRibbonControl.xlsx. It contains a group called
"GroupCommunicate", which includes the following idMso's:
NewMessageToContact, NewMeetingWithContact, DialMenu, Call,
NewTaskForContact, ContactWebPage and MapContactAddress - exactly the things
I listed before - we have every ribbon button in the communicate section.

Yet, when I define my ribbon XML as follows:

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="Ribbon_Load">
<commands>
<command idMso="ForwardAsBusinessCard" onAction="ForwardOverride"/>
<command idMso="DialMenu" onAction="DialMenuOverride"/>
<command idMso="Call" onAction="CallOverride"/>
</commands>
<ribbon>
</ribbon>
</customUI>

The only event that is triggered is ForwardOverride - for the other two, the
default action is triggered and the methods DialMenuOverride and CallOverride
are never triggered.

Do you have any idea how to repurpose the items in the list that pops up
when pushing the call button?

Regards
Stephan
 
K

Ken Slovak - [MVP - Outlook]

The schema you want for contacts is "OutlookAddressItemRibbonControls.xls".

There's also a trick that can be used in most cases. Right-click on the
ribbon on the line where the tab names are in an open item and select
Customize Quick Access Toolbar. In the customize dialog select All Commands
in the Choose drop-down. When you hover over a command the schema name will
show up as a tip.

There are 2 commands listed there for Call: Call and DialMenu.

So it looks like your XML should be OK, it just may be an inability to
repurpose those commands. I'm not familiar with playing with those controls,
but I know for a fact that you cannot repurpose the Send button at all. This
may be a similar situation.
 

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