-2

我尝试将我的文件 myfile.xlsb 重命名为 myfile.zip 然后打开 zip 存档,在其中创建文件夹 customUI,将数据放入此文件夹文件 customUI.xml

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
               <backstage>
                              <tab idMso="TabShare" visible="false"/> 
               </backstage>
</customUI>

然后尝试使用数据

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

接着

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

然后我放入 .rels 文件

<Relationship Id="rId5" 
Type="http://schemas.microsoft.com/office/2006/relationships/
ui/extensibility" Target="customUI/customUI.xml"/>

在所需的标签之间并在 zip 存档中更改此文件。然后我将 myfile.zip 重命名为 myfile.xlsb 并打开它,但所有发送按钮仍然存在。我还尝试更改所有参考(http://schemas.microsoft.com/office/2006/relationships/http://schemas.microsoft.com/office/2009/07/customui)但没有效果

这个也没有隐藏这个按钮。

Application.CommandBars("Worksheet Menu Bar").Controls("File").Controls("Send To").Enabled = False
Application.CommandBars("Worksheet Menu Bar").Controls("File").Controls("Save & Send").Enabled = False

我需要禁用这个并从 VBA 控制它。

Control Name:   SendCopySendToMailRecipient ; FileEmailAsPdfEmailAttachment ; FileEmailAsXpsEmailAttachment ; SendUsingEmail ; GroupSendUsingEmail
Control Type:   toggleButton ; button ; button ; task ; group
Tab Set:    None (Not in the Ribbon) ; None (Not in the Ribbon) ; None (Not in the Ribbon) ; None (Backstage View) ; None (Backstage View)
Tab:    None (Not in the Ribbon) ; None (Not in the Ribbon) ; None (Not in the Ribbon) ; TabShare ; TabShare
Group:  - ; None (Not in the Ribbon) ; None (Not in the Ribbon) ; GroupShare ; GroupShare
Parent Control:     - ; FileSendMenu ; FileSendMenu ; Share ; Share
Secondary Parent Control:   - ; - ; - ; - ; SendUsingEmail          
Policy ID:  3738 ; 15730 ; 15731 ; 18209 ; 18166
Ordering:       645 ; 1049 ; 1050 ; 2219 ; 2220
4

1 回答 1

0

这几乎隐藏了所有内容 - 也许有帮助:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
   <ribbon startFromScratch="true">
   <qat>
     <documentControls>
    <control 
       idMso="WindowSwitchWindowsMenuExcel"
       screentip="SWITCH EXCEL FILE"
       supertip="Click here to switch from this workbook to another open excel file."/>
    <control 
       idMso="FilePrint"
       screentip="PRINT FILE"
       supertip="Click here to enable the print menu."/>
     </documentControls>
    </qat>
    </ribbon>
</customUI>
于 2014-06-12T12:30:23.750 回答