If you are working with RibbonX code in Microsoft Office, you no doubt use the CustomUI editor from OpenXML Developer.
The tool has is an essential one for working with RibbonX and Office as it offers us the following advantages:
- Much easier than manual adjustments to the Office file
- A button to validate the XML for correctness
- An easy way to import and rename pictures
- A tool to generate callbacks with the correct syntax
- Ability to generate sample XML code to start from
I will honestly say that I will not try to attempt to modify RibbonX code without it.
There is one thing that you need to be aware of, however, and that is the danger of overwriting your file by accident.
To modify your XML markup, you open your file in the CustomUI tool, edit it, and save it.Â If you're anything like me, though, you then open it up in your application without closing the CustomUI file.Â Why?Â Because you have to ensure your controls are correctly referenced in VBA code and the spelling is important.
The danger of this is making updates to your XML.Â If you've already added a ton of VBA code, saved the file (Excel workbook, Word doc, etc...) and exited it, well... no big deal.Â The issue comes in if you edit the XML in the document that still sits open in your CustomUI editor, then save it.Â *Poof!*Â There goes the code you programmed.
It's like a copy of the file is opened in the CustomUI tool.Â You can't overwrite the file until it's closed, but when you do, it's overwritten with the copy that is open in the CustomUI tool, not updated.
So, rule of thumb, if you are keeping the XML open to review, is to close the source file, then close and re-open the file showing in the CustomUI editor.
Hopefully it saves someone from re-writing a bunch of code.Â 🙂