有时候我们开发进销存或是
仓库管理
表格,希望把Excel的系统按钮隐藏起来,只显示我们需要的按钮,或者自定义的按钮。其实很简单,只要编辑
customUI就可以了,下面是一个示例:
customUI.xml
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<commands>
<command idMso="FileExit" enabled="false" />
<command idMso="ApplicationOptionsDialog" enabled="false" />
<command idMso="WindowMinimize" enabled="false"/>
<command idMso="WindowRestore" enabled="false"/>
<!--
<command idMso="WindowClose" enabled="false"/>
-->
<command idMso="Help" enabled="false"/>
</commands>
<ribbon startFromScratch="true">
<officeMenu>
<button idMso="FileNew" visible="false" />
<button idMso="FileOpen" visible="false" />
<button idMso="FileSave" visible="false" />
<splitButton idMso="FileSaveAsMenu" visible="false" />
<splitButton idMso="FilePrintMenu" visible="false" />
<menu idMso="FileServerTasksMenu" visible="false" />
<menu idMso="FileSendMenu" visible="false" />
<menu idMso="MenuPublish" visible="false" />
<button idMso="FileClose" visible="false" />
<menu idMso="FilePrepareMenu" visible="false" />
</officeMenu>
<contextualTabs>
<tabSet idMso="TabSetSmartArtTools" visible="false" />
<tabSet idMso="TabSetChartTools" visible="false" />
<tabSet idMso="TabSetDrawingTools" visible="false" />
<tabSet idMso="TabSetPictureTools" visible="false" />
<tabSet idMso="TabSetPivotTableTools" visible="false" />
<tabSet idMso="TabSetHeaderAndFooterTools" visible="false" />
<tabSet idMso="TabSetTableToolsExcel" visible="false" />
<tabSet idMso="TabSetPivotChartTools" visible="false" />
<tabSet idMso="TabSetInkTools" visible="false" />
</contextualTabs>
</ribbon>
</customUI>