To remove a whole menu group, this link has the answer:
http://blogs.msdn.com/dipper/archive/2006/10/05/How-to-Remove-or-hiding-items-in-List-toolbar-in-Sharepoint-Server-2007.aspx
To summarize it (in my understanding and language):
In \12\TEMPLATE\CONTROLTEMPLATES there are many templates. By just dropping a new template file (file name doesn’t seem to matter) with
<SharePoint:RenderingTemplate ID=”DocumentLibraryViewToolBar” runat=”server”>
it will override the default template defined in DefaultTemplates.ascx. So even DefaultTemplates.ascx still has that menu groups, it will be hidden on UI. IISRESET or application pool need to be recycled before this takes effect.
However, this \12\TEMPLATE\CONTROLTEMPLATES folder is shared by all sites installed on same server. What if other sites don’t want to hide that menu group? Here is my trick: make a copy of that “ControlTemplates” folder and put the customized file there. Then go to InetMgr and change the virtual directory path to point to the new folder for those applications that want this change.
This is the file to hide “New” menu group in Doc Lib page toolbar:
==================================
<%@ Control Language=”C#” AutoEventWireup=”false” %>
<%@Assembly Name=”Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” %>
<%@Register TagPrefix=”SharePoint” Assembly=”Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” namespace=”Microsoft.SharePoint.WebControls”%>
<%@Register TagPrefix=”SPHttpUtility” Assembly=”Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” namespace=”Microsoft.SharePoint.Utilities”%>
<%@ Register TagPrefix=”wssuc” TagName=”ToolBar” src=”~/_controltemplates/ToolBar.ascx” %>
<%@ Register TagPrefix=”wssuc” TagName=”ToolBarButton” src=”~/_controltemplates/ToolBarButton.ascx” %>
<SharePoint:RenderingTemplate ID=”DocumentLibraryViewToolBar” runat=”server”>
<Template>
<wssuc:ToolBar CssClass=”ms-menutoolbar” EnableViewState=”false” id=”toolBarTbl” ButtonSeparator=”<img src=’/_layouts/images/blank.gif’ alt=”>” RightButtonSeparator=” ” runat=”server”>
<Template_Buttons>
<SharePoint:UploadMenu AccessKey=”<%$Resources:wss,tb_UploadMenu_AK%>” runat=”server”/>
<SharePoint:ActionsMenu AccessKey=”<%$Resources:wss,tb_ActionsMenu_AK%>” runat=”server”/>
<SharePoint:SettingsMenu AccessKey=”<%$Resources:wss,tb_SettingsMenu_AK%>” runat=”server”/>
</Template_Buttons>
<Template_RightButtons>
<SharePoint:PagingButton runat=”server”/>
<SharePoint:ListViewSelector runat=”server”/>
</Template_RightButtons>
</wssuc:ToolBar>
</Template>
</SharePoint:RenderingTemplate>
================================
When it comes to removing a particular menu from a menu group, things didn’t work as expected. You are supposed to do that through a Feature and use <HideCustomAction> to hide a particular menu. There is no where you can get a complete list of IDs of all the menu items. I tried this:
<HideCustomAction>
GroupId = “ActionsMenu”
HideActionId = “ExportToSpreadsheet”
Id = “HideExportToSpreadSheetMenu”
Location = “Microsoft.SharePoint.StandardMenu”>
</HideCustomAction>
But it didn’t work. I tried a few other combinations of Export To Spreadsheet and none of worked. Google search only returns similar failed attempts. (This page gives you the group IDs).
My workaround is to directly edit DefaultTemplates.ascx file in ControlTemplates folder. Then it’s permanently gone. Backup the file before you make change. Follow aforementioned trick if other sites in same server don’t want the change.