How to create a new button in the ribbon


  • <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="">
     <CustomAction Id="Ribbon.List.Actions.AddAButton" Location="CommandUI.Ribbon" RegistrationId="100" RegistrationType="List" Title="My Custom Ribbon Button">
        <CommandUIDefinition Location="Ribbon.List.Actions.Controls._children">
         <Button Id="Ribbon.List.Actions.NewRibbonButton" Command="MyNewRibbonButtonCommand" LabelText="My custom button" TemplateAlias="o1"/>
        <CommandUIHandler Command="MyNewRibbonButtonCommand" CommandAction="javascript:alert('This is my custom button!');" />

    With this code i create a new button in the ribbon:


    And i get the following result:

    How can i place my button inside a different tab or in a different position in the ribbon?

    Monday, October 18, 2010 9:56 AM


All replies