Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm trying to hide the "Upload Document" button (including the Upload Document and Upload Multiple Documents submenu). I've tried the following XML, but I can't get it to work:

  <CustomAction
    Id="RemoveRibbonButton"
    Location="CommandUI.Ribbon">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition
          Location="Ribbon.Documents.New.AddDocument" />
      </CommandUIDefinitions>
    </CommandUIExtension>
  </CustomAction>
  <CustomAction
    Id="RemoveRibbonButton"
    Location="CommandUI.Ribbon"
    RegistrationId="0x0101" 
    RegistrationType="ContentType">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition
          Location="Ribbon.Documents.New.AddDocument" />
      </CommandUIDefinitions>
    </CommandUIExtension>
  </CustomAction>

Doing this removes the submenu, but makes the "New Folder" button, which I also have hidden, reappear:

<CustomAction
    Id="RemoveRibbonButton"
    Location="CommandUI.Ribbon"
    RegistrationId="0x0101" 
    RegistrationType="ContentType">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition
          Location="Ribbon.Documents.New.AddDocument.Menu.Upload" />
      </CommandUIDefinitions>
    </CommandUIExtension>
  </CustomAction>

I want this button hidden because we have made our own file upload control and button and we no longer want the default SharePoint one to display.

EDIT: Just to clarify, I need the solution to be via XML. All of our Ribbon customizations are via XML, so using server-side code or CSS/JavaScript is not an option.

share|improve this question
add comment

1 Answer

You can do this using the SPRibbon class: http://www.3guysonsharepoint.com/?p=778

If you wish to remove multiple uploads use

Ribbon.Documents.New.AddDocument.Menu.Upload.UploadMultiple

The following is a walkthrough for Removing a Button from the Server Ribbon: http://msdn.microsoft.com/en-us/library/ff408060.aspx

Or, alternatively, you can use a css trick to hide them: http://www.patricktalmadge.com/2011/04/09/hide-multiple-upload-link-in-sharepoint-2010/

share|improve this answer
    
Thanks, but as you can obviously tell from my XML, I know how to remove a button from the ribbon. My question is how to remove this particular button via XML. Doing it through code is not an option because all of my other ribbon customizations are already XML based. –  MgSam Aug 24 '12 at 12:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.