I ran across an interesting situation today in the Word 2007 Ribbon. In a project that I’m working on, the FormatPainter Ribbon control wasn’t showing up in a custom tab. Here is the Ribbon XML element that was being used:
<toggleButton idMso=”FormatPainter” imageMso=”FormatPainter” />
I double checked the idMso and control type in the Microsoft 2007 Office System Document: Lists of Control IDs Word Ribbon Controls Excel spreadsheet. I had entered the idMso correctly and I had the correct control type, according to the spreadsheet.
Next I wanted to see if the problem was isolated to my project and not with Word itself. I opened a new Word 2007 Add-In project and added the same code to a custom tab. Again, no Format Painter control. But, this time I was able to see the error message that indicated that the control type was incorrect. It turns out that the FormatPainter control is referenced as “control” not “togglebutton“.
Here is the updated Ribbon XML element:
<control idMso=”FormatPainter” imageMso=”FormatPainter”/>
Now the FormatPainter control shows up as expected in my custom tab.