开发者

Why doesn't my CreateRibbonExtensibilityObject method get called?

开发者 https://www.devze.com 2022-12-31 02:16 出处:网络
Hi I\'ve been tinkering around with the two techniques to modify the ribbon with an MS Word addin (Visual Studio 2010, .NET 3.5), a Microsoft.Office.Tools.Ribbon.OfficeRibbon and Micr开发者_开发知识库

Hi I've been tinkering around with the two techniques to modify the ribbon with an MS Word addin (Visual Studio 2010, .NET 3.5), a Microsoft.Office.Tools.Ribbon.OfficeRibbon and Micr开发者_开发知识库osoft.Office.Core.IRibbonExtensibility. I was hoping to switch between the two in my addin's CreateRibbonExtensibilityObject, but for some reason it is not called now. The documentation says that if an addin implements CreateRibbonExtensibilityObject that it will be called. When I create a fresh project to test doing this very thing, it works. I'd prefer not to abandon my project as-is. Any ideas? Thank you.


They're not really interchangeable. The issue is that if you use the OfficeRibbon object (which is really pretty nice, it's got a nice designer etc) then IT implements the createribbonextensibility stuff and you don't have a chance to intercept it.

I did a blog post last year that discussed the problem with respect to adding support for the new Office 2010 "Backstage view" from a VSTO 3 addin (VSTO 3 doesn't support Backstage, but it's still doable, and you'd basically use the same technique to swap out implementations of the ribbon support).

the real question is, why bother? If you've done the work to support IExtensibility2 (and then have the ability to completely define your ribbon object in XML), there's not much of a need for the OfficeRibbon. and if you're using the officeribbon control, it can do jsut about everything you could do specifying the xml directly, so why suffer the pain?

Blog post here http://www.vbfengshui.com/integrating-with-the-new-office-backstage-from-a-vsto-3-addin/

0

精彩评论

暂无评论...
验证码 换一张
取 消