开发者

How to create custom WPF ribbon tab for COM AddIn

I have a shared COM AddIn (not VSTO) for excel 2003, now I want to add a ribbon tab to support excel 2007. I did some research online. know that I need reference 2007 PIA, implement IDTExtensibility2, IRibbonExtensibility in my connection and IRibbonExtensibility has only one method string GetCustomUI()

    string IRibbonExtensibility.GetCustomUI(string RibbonID)
    {
        return Properties.Resources.Ribbons;
    }

I add ribbons.xml in resources, ribbons.xml is as follows:

Not sure if this is the good/right way to do. I want to customize like add icon to button, largeimage, smallimgae, connect command to button, etc. I feel in xml, it is hard to do this.

There must be better way to a开发者_JAVA技巧chieve this, please let me know how

thanks


Nope, that's about it when doing a shared addin without vsto.

You MIGHT be able to create a VSTO addin, setup the ribbon using that project, then extract just the ribbon control files and move them to youre shared add in.

In that case, for your GETCUSTOMUI method, you'd have to call the ribbon control to render it's XML manually and pass that on through. I experimented briefly with that several months back but other things came up and I had to leave it.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜