Ribbon callbacks: how to direct them to a specifc module in COM ad

M

Miles

Some of the articles online show how to qualify a callback name with its
module (e.g. onLoad="module.myCallback") in the Ribbon xml, but this is only
for VBA modules.

My COM addin is in VB6. My (mis?)understanding is that callbacks are
supposed to be in the Connect module that implements IRibbonExtensibility.
Can someone suggest a way that I can neatly separate my Ribbon-related code
into a separate module or class? Alternately, just what is the rule that
determines which module gets the callbacks?
 
K

Ken Slovak - [MVP - Outlook]

The rule is that the module that handles OnConnection() from extensibility
must be the module you use for the ribbon callbacks. That is where you put
your Implements statement for IRibbonExtensibility.

From those callbacks you can call into a dedicated class or code module that
holds procedures called from the ribbon callbacks, but the ribbon callbacks
must be in that connect module.
 
M

Miles

Thanks for the clear & unambiguous answer, Ken. I'd read this between the
lines in various sources, but you're the first to lay it down clearly. Do
you know where this rule is documented so clearly? Sounds like I might
further my education by reading more from that source...
 
K

Ken Slovak - [MVP - Outlook]

Not in so many words all in one place, no, I've never seen this documented.
I was specifically informed of this during the Office 2007 beta though by
the owner and other members of the Ribbon team, and by a friend who owns the
Outlook object model on the Outlook team.

Have you looked at http://msdn.microsoft.com/en-us/library/aa338202.aspx as
a starting point for ribbon customizations?
 
M

Miles

Yup! I was trying to "improve" things by making them more modular by putting
the Ribbon logic in its own class. However, a few Ribbon callbacks in the
Connection module won't kill me... though they do bug me! At least, you're
definitively resolved the issue.
 
K

Ken Slovak - [MVP - Outlook]

The implication of the line in those articles that the callbacks must be
public is the giveaway that they must be in that Connect class. That's the
only one in your addin that's actually public, and along with the
requirement that the implementation of IRibbonExtensibility be in the same
module as the one that implements IDTExtensibility is the tip off that
everything has to be in that class.
 

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