編輯

共用方式為


Export, prepare to edit, and import the ribbon

Note

This topic is about classic commands.

There is a new way to define commands. See Modern commanding overview (preview).

To edit the ribbon, you must perform the following steps:

  1. Export the ribbon

  2. Prepare to edit the XML

  3. Edit the <RibbonDiffXml>

  4. Import the ribbon

Export the ribbon

You export the ribbon by including it in a solution and then exporting the solution. You can export all the customizations, but that can represent a large amount of data. We recommend that you use an existing unmanaged solution or create a new solution.

Create a new solution

  1. Go to Settings > Customizations.

  2. Go to Settings > Solutions.

  3. Select New.

  4. Type a meaningful Display Name, Name and enter a Publisher and type a Version number.

    Note

    You can usually use the default publisher for the organization.

  5. Select the Save icon.

  6. If you want to edit the ribbon for specific tables:

    1. Select Add Existing and then select Entity.

    2. Select the tables you want to include in the solution and then select OK.

      Note

      For the purpose of editing table ribbons, you do not have to include required components. If you intend to export this solution and apply it to another system, you should include required components.

  7. If you want to edit global ribbons or add a custom group to all tables, select Add Existing and then select Application Ribbons.

  8. Select Save and Close.

Use an existing solution

  1. Go to Settings > Customizations.

  2. Go to Settings > Solutions.

  3. Double-click a solution to open it.

  4. If you want to edit the ribbon for specific tables:

    1. Select Add Existing and then click Entity.

    2. Select the tables you want to include in the solution and then select OK.

      Note

      For the purpose of editing table ribbons, you do not have to include required components. If you intend to export this solution and apply it to another system, you should include required components.

  5. If you want to edit global ribbons, such as to add custom button to all tables: select Add Existing and then select Application Ribbons.

  6. Select Save and Close.

Export the ribbon

  1. Go to Settings > Customizations.

  2. Go to Settings > Solutions.

  3. Select the solution you want and then select Export.

  4. If you have made recent changes that have not yet been published, select Publish All Customizations. Otherwise, select Next.

  5. With the Unmanaged option selected, select Export.

  6. Select Save in the File Download dialog box and then select Open Folder in the Download complete dialog box.

  7. Right-click the compressed .zip file that you downloaded and select Extract All... .

  8. Select a location to extract the files and then select Extract.

  9. The customizations.xml file is the file that you will edit.

Prepare to edit the XML

or a better experience, edit the customizations.xml file with an application that can use schema validation to provide IntelliSense support. For more information, see Edit the customizations file with schema validation.

Import the ribbon

  1. After you have edited the customization.xml file, from Visual Studio or Visual Web Developer 2010 Express, right-click the customization.xml tab and select Open Containing Folder.

  2. Select all of the files or folders that were included when you extracted the solution. Right-click the selected files, select Send to, and then select Compressed (zipped) folder.

    Note

    This creates a compressed .zip file in the same folder. The name of the file may vary, but it will be the same as one of the other files in the folder - except with a .zip file name extension.

  3. Go to Settings > Customizations.

  4. Go to Settings > Solutions.

  5. Select Import.

  6. Select Browse and locate the compressed .zip file that you created in step 2 of this procedure.

  7. Select Next and then select Import.

  8. After the import has finished, you will see the message indicating that the import completed successfully. Select Close.

  9. After you have successfully imported your solution, you must publish customizations before you can see the changes. In the solutions list, select Publish All Customizations.

Dealing with errors on import

  1. If you receive a notification that there were errors that caused the import to fail, select Export Log.

  2. Save the export log file. Select the file and right-click it. Click Open With and then select Microsoft Office Excel.

  3. Select the Components worksheet and note any messages in the ErrorText column.

    Tip

    The most common type of failure is an error when referencing a dependent element in the RibbonDiffXml. Perhaps you forgot to include a LocLabel that was referenced somewhere. Perhaps there is an extra blank character included at the end of an XML parameter referencing another element. All references must match exactly.

  4. After you have corrected the error, complete the steps to import the ribbon again.

Troubleshoot ribbon issues

If you are experiencing an issue with a ribbon command bar button, use this troubleshooting guide to find and solve the problem.

See also

Customize the ribbon
Export ribbon definitions
Use localized labels with ribbons