views:

71

answers:

1

I am writing an addin to Office (both 2007 and 2010), and have so far used the Fluent Ribbon XML to customize the different ribbons.
The problem I am having now with that approach, is that I want to have a bit more flexibility in my code, and have different modules add more buttons to the ribbon, without hard coding them in XML - The addin is composed of several disconnected modules, and it doesn't "know" exactly what ribbon elements it might need.

Is there a way to do it? I bumped into the LoadCustomUI method on the Application object, but it is not available in C#. Looks like just what I might have used for my scenario.

+1  A: 

For .NET 4 (which I assume you're using because of targetting Office 2010), you'll override CreateRibbonExtensibilityObject. More info can be found on this page: Ribbon Object Model. This is also a good read: Updating the Controls on a Ribbon at Run Time.

Otaku
Sadly, I am using .Net 2.0, but I will look into these articles and maybe find some more reasons to upgrade to 4.0 already.Thanks for the links.
Noam Gal