I'm using the Custom UI Editor for Office provided by Microsoft to create custom Ribbon Tab for Excel 2007. I didn't find how to change the color of a Ribbon.
Here a sample:
<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>
I've placed an XML tag like COLOR="green" or BACKCOLOR="green" at TAB level, but wiyh no results.
Best regards, Stefano
Doesn't look like this can be done using standard Microsoft Office vsto functionality.In the code sample below I'm looping through the custom tabs in my ribbon and writing the properties to the output window. Alternatively you can place a brake point in the second foreach loop and go through all the properties in the RibbonTab object. As far as I can see none of them expose a property which allows you to change the colour of the ribbon tab:
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);
}
}
}