
Exporting a Ribbon from the Ribbon Designer to Ribbon XML
If you create a Ribbon by using the Ribbon Designer, and then decide that you want to customize the Ribbon in ways that the Ribbon (Visual Designer) item does not support, you can export the Ribbon to XML.
Visual Studio Tools for Office automatically creates a Ribbon (XML) item and populates the Ribbon XML file with elements and attributes for each control on the Ribbon.
Not all of the properties that are in the Properties window of the Ribbon designer are transferred to the Ribbon XML file. For example, Visual Studio Tools for Office does not export the value of the Image or Text property. That is because you must create a callback method in the Ribbon code file of the exported project to assign an image or set the text of a control. Visual Studio Tools for Office does not automatically generate callback methods as part of the export process.
In addition, any unchanged default property values do not appear in the resulting Ribbon XML file.
For more information about how to export the Ribbon to XML, see How to: Export a Ribbon from the Ribbon Designer to Ribbon XML.
Updating the Code
A new Ribbon code file is added to Solution Explorer. This file contains the Ribbon XML class. You must create callback methods in the Ribbon Callbacks region of this class to handle user actions, such as clicking a button. Move your code from the event handlers to these callback methods and modify the code to work with the Ribbon extensibility (RibbonX) programming model. For more information, see Ribbon XML.
You must also add code to the ThisAddIn, ThisWorkbook, or ThisDocument class that overrides the CreateRibbonExtensibilityObject method and returns the Ribbon XML class to the Office application.
For more information, see Ribbon XML.