IRibbonExtensibility and specific folders

  • Thread starter Thread starter Michael Tissington
  • Start date Start date
M

Michael Tissington

I have implemented IRibbonExtensibility but how can I only load the ribbon
when the Outlook form is from a specific folder or message class (we have an
ECE that does this for pre 2007)

The RibbonID does not seem to reflect the actual message class.
 
If I remember correctly, you should be able to specify the ribbon visiblity
callback, which will be called each time a ribbon is shown.
You might want to post in microsoft.public.outlook.program_addins and/or
microsoft.public.developer.outlook.addins.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Thanks, have you been able to connect your ece to the class containing the
ribbon code ?
 
I simply created a simply separate class for the COM add-in and communicates
with ECE using global variables. In case of OutlookSpy the ribbon hanling is
very simple - it is always shown no matter what :-)
I did ribbon related functionality for several other add-ins, but there the
show/hide ribbon logic was based on the sent/unsent state of the item.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
You can use the RibbonID though to narrow it already down. That means,
only send your RibbonX back to Outlook via GetCustomUI for those
RibbonIDs that could be used for your message class.
Then implement getVisible and getEnabled callbacks for your top-level
item (tab or group). When getVisible/getEnabled get called, you get an
IRibbonControl object that has a Context properties. You can use that
Context property to get a handle to the current Inspector and from there
figure out your message class. If it's the right message class, return
true, otherwise return false.
Why getVisible and getEnabled? Ribbon items that are not visible are
nonetheless included in the Options, Customize dialog. So a user could
potentially add any of those not available items to his or her QAT and
then call them when he or she shouldn't be able to call them. Therefore
you need to disable them as well.
You'll have to implement an Outlook event though to invalidate your
top-level control whenever you want to change the two attributes.

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
Office 2007 Beta 2 Technical Refresh (B2TR):
http://pschmid.net/blog/2006/09/18/43
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed
 
Back
Top