Office 2007/2010自定义function区UI如何更改选项卡颜色XML标签

我正在使用Microsoft提供的Office自定义用户界面编辑器为Excel 2007创build自定义function区选项卡。我没有find如何更改function区的颜色。

这里是一个例子:

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"> <ribbon startFromScratch="false"> <tabs> <tab id="customTab" label="FUNCTION MENU"> <group id="customGroup" label="LABEL"> <button id="btnrefreshALL" label="BUTTONLABEL" imageMso="RefreshAll" size="large" onAction="AggiornaALLData" /> <separator id="sep01" /> </group> </tab> </tabs> </ribbon> 

我在TAB级别放置了一个XML标签,如COLOR =“green”或者BACKCOLOR =“green”,但是没有结果。

最好的问候,斯特凡诺

看起来不像这样可以使用标准的Microsoft Office vstofunction来完成。在下面的代码示例中,我循环浏览function区中的自定义选项卡,并将属性写入输出窗口。 或者,您可以在第二个foreach循环中放置制动点,然后遍历 RibbonTab对象中的所有属性。 据我可以看到他们都没有暴露一个属性,允许您更改function区选项卡的颜色:

 private void ThisAddIn_Startup(object sender, System.EventArgs e) { Ribbon1 ribbon = new Ribbon1(); foreach (Microsoft.Office.Tools.Ribbon.RibbonTab tab in ribbon.Tabs) { //Writes to the Output Window(Press Ctrl+W+O to activate) foreach(System.Reflection.PropertyInfo propertyInfo in tab.GetType().GetProperties()) { string info = String.Format("Property name - {0}, Property type - {1}", propertyInfo.Name,propertyInfo.PropertyType); System.Diagnostics.Debug.WriteLine(info); } } }