共用方式為


Office) (CommandBar.Visible 屬性

取得或設定命令列的 Visible 屬性。 True 是表示 如果命令列會顯示。 讀取/寫入。

注意事項

[!注意事項] CommandBars 用於部分的 Microsoft Office 應用程式已經由 Microsoft Office Fluent 使用者介面的新功能區元件取代。 如需詳細資訊,請參閱 Office Fluent 功能區概觀

語法

運算式可見

表達 代表 CommandBar 物件的變數。

傳回值

布林值

註解

Visible 屬性剛建立的自訂命令列是 False 預設。

將命令列的 Enabled 屬性必須設定為 True 之前的 Visible 屬性設為 True

範例

This example steps through the collection of command bars to find the Forms command bar. If the Forms command bar is found, the example makes it visible and protects its docking state.

foundFlag = False  
For Each cmdbar In CommandBars 
    If cmdbar.Name = "Forms" Then 
        cmdbar.Protection = msoBarNoChangeDock 
        cmdbar.Visible = True  
        foundFlag = True  
    End If 
Next 
If Not foundFlag Then 
    MsgBox "'Forms' command bar is not in the collection." 
End If

另請參閱

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應