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

此生再无相见时 提交于 2019-12-20 06:16: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:


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.



来源:https://stackoverflow.com/questions/11697013/remove-save-send-from-file-menu-in-excel-2010-using-custom-xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!