2014-10-08 103 views
0

對於Excel我使用屬性startFromScratch =「True」刪除功能區選項卡,但它也刪除工作簿的關閉按鈕(請參見圖片)。有沒有辦法不刪除它?我知道你可以使用startFromScratch,另外你可以通過VBA顯示你想要的標籤,如下所示:http://www.msofficegurus.com/post/Customizing-the-Ribbon-startFromScratch-and-Tab-visibility.aspxstartFromScratch正在刪除工作簿的關閉(x)按鈕

現在,是否可以再次添加關閉按鈕?我相信可能有類似的代碼來通過VBA展示它。

Before and after startFromScratch

回答

0

這是我使用的代碼:我使用下面的XML不隱藏這些按鈕

<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的版本:

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

嗨whytheq。感謝您的回答,但不幸的是這不是我在找:(我可以用它來添加一個密切的工作簿botton,但我想顯示圖片中顯示的默認關閉工作簿。 – Braulio 2014-10-08 18:05:27

+0

您是否測試了此代碼 - 它不會在我的Excel中隱藏這些按鈕。您使用的是什麼版本的Excel? – whytheq 2014-10-08 22:00:50

+0

是的,我已經嘗試過了.xmlns地址不適用於我,因爲我的辦公室是2010年,但是我試過的其他代碼關閉按鈕仍然不顯示:( – Braulio 2014-10-09 12:12:16