【问题标题】:startFromScratch is removing the close (x) button of workbookstartFromScratch 正在删除工作簿的关闭 (x) 按钮
【发布时间】:2015-10-16 23:26:44
【问题描述】:

对于 Excel,我使用属性 startFromScratch="True" 删除功能区选项卡,但它也删除了工作簿的关闭按钮(见图)。有没有办法不去掉?我知道您可以使用 startFromScratch 并单独通过 VBA 显示您想要的选项卡,如本网站所述:http://www.msofficegurus.com/post/Customizing-the-Ribbon-startFromScratch-and-Tab-visibility.aspx

现在,是否可以再次添加关闭按钮?我相信可能有类似的代码可以通过 VBA 显示。

【问题讨论】:

    标签: vba excel ribbon


    【解决方案1】:

    这是我使用的代码:

    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
    <ribbon startFromScratch="true">
    <qat>
     <documentControls>
    <control 
       idMso="FileSaveAs"
       screentip="SAVE AS..."
       supertip="Click here to save this file to another location."/>
    <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>
    

    编辑

    在我使用的 Excel 版本中,以下 xml 不会隐藏这些按钮:

    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
      <ribbon startFromScratch="true"></ribbon>
    </customUI>
    

    【讨论】:

    • 嗨,为什么。感谢您的回答,但不幸的是,这不是我要找的 :( 我可以用它来添加关闭工作簿按钮,但我想显示默认关闭工作簿,如图所示。
    • 您是否测试过这段代码 - 它不会在我的 Excel 中隐藏这些按钮。您使用的是哪个版本的 Excel?
    • 是的,我试过了。 xmlns 地址对我不起作用,因为我的办公室是 2010 年,但是我尝试了其余代码并且关闭按钮仍然没有显示:(
    猜你喜欢
    • 2011-09-19
    • 2018-11-07
    • 1970-01-01
    • 1970-01-01
    • 2014-02-24
    • 1970-01-01
    • 1970-01-01
    • 2016-05-14
    • 1970-01-01
    相关资源
    最近更新 更多