Remove “Save & Send” from File menu in Excel 2010

2020-05-06 11:40发布

Could someone please help me modify the following XML code (Office 2007) so that it works in Office 2010? I've included my XML from Office 2007 below:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
    <officeMenu>
        <menu idMso="FileSendMenu" enabled="false"/>
        <menu idMso="FileEmailAsPdfEmailAttachment" enabled="false"/>
        <menu idMso="FileEmailAsXpsEmailAttachment" enabled="false"/>
        <menu idMso="FileSendAsAttachment" enabled="false"/>
    </officeMenu>
</ribbon>

I canNOT figure out why my schema isn't working. It doesn't help that I know nothing about XML and I'm just kind of fumbling around in the dark here. My goal is to ideally remove (or at least disable) the "Save & Send" menu item under the File menu in Excel 2010. I am not finding any documentation on the XML structure for Office 2010, which seems to have changed significantly from Office 2007.

1条回答
太酷不给撩
2楼-- · 2020-05-06 12:22

So of course right after I asked this question I found the solution. Here's the format to remove the various items under the File ribbon (what is now apparently called backstage in Office 2010):

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<backstage>
    <button idMso="FileSave" visible="false"/>
    <button idMso="FileSaveAs" visible="false"/>
    <button idMso="FileOpen" visible="false"/>
    <button idMso="FileClose" visible="false"/>
    <button idMso="ApplicationOptionsDialog" visible="false"/>
    <button idMso="FileExit" visible="false"/>
    <tab idMso="TabInfo" visible="false"/>
    <tab idMso="TabRecent" visible="false"/>
    <tab idMso="TabNew" visible="false"/>
    <tab idMso="TabPrint" visible="false"/>
    <tab idMso="TabShare" visible="false"/>
    <tab idMso="TabHelp" visible="false"/>
    </backstage>
</customUI>

This will remove every option under the File menu. You can obviously selectively remove/show the elements you want to.

查看更多
登录 后发表回答