共用方式為


Office) (CommandBarButton 成員

代表命令列上的按鈕控制項。

事件

名稱 描述
Click 發生於使用者按一下 CommandBarButton 物件。

方法

名稱 描述
Copy 會將命令列按鈕控制項複製到現有的命令列。
CopyFace 會將命令列按鈕控制項的圖像複製到剪貼簿。
Delete 會將 CommandBarButton 物件從其集合中刪除。
執行 會執行的程序或內建命令指派給指定的 CommandBarButton 控制項。
Move 會將指定的 CommandBarButton 控制項移動到現有的命令列。
PasteFace 將貼到 CommandBarButton 剪貼簿] 內容。
Reset 重設為內建的 CommandBarButton 控制項原來的功能及圖像。
SetFocus 將鍵盤焦點移至指定的 CommandBarButton 控制項。 如果 [] 按鈕已停用或不可見,這個方法會失敗。

屬性

名稱 描述
應用程式 會取得代表 CommandBarButton 物件 (可以 Automation 物件使用這個屬性可傳回該物件的容器應用程式) 的容器應用程式的 Application 物件。 唯讀。
BeginGroup 如果指定的命令列控制項顯示的命令列上控制項的群組開頭會會取得 True 。 讀取/寫入。
BuiltIn 如果指定的命令列控制項是容器應用程式,則 為 True 。 如果是自訂的控制項,或其 OnAction 屬性已設內建控制項時則傳回 False 。 唯讀。
BuiltInFace 如果命令列按鈕控制項的圖像為其原始的內建圖示,則 為 True 。 讀取/寫入。
Caption 會取得或設定命令列控制項的標題文字。 讀取/寫入。
Creator 會取得指出用來建立 CommandBarButton 物件的應用程式的 32 位元整數。 唯讀。
DescriptionText 會取得或設定命令列按鈕控制項的描述。 讀取/寫入。
Enabled True 是表示 如果指定的 CommandBarCommandBarControl 已啟用。 讀取/寫入。
FaceId 取得或設定 CommandBarButton 控制項的圖像識別碼。 可讀寫。
Height 會取得或設定命令列控制項的高度。 可讀寫。
HelpContextId 取得或設定的說明內容附加至 CommandBarButton 控制項的 [說明] 主題的識別碼編號。 可讀寫。
HelpFile 取得或設定 CommandBarButton 控制項的 [說明] 主題的檔案名稱。 讀取/寫入。
HyperlinkType 取得或設定 MsoCommandBarButtonHyperlinkType 常數,代表與指定命令行按鈕相關聯的超連結類型。 可讀寫。
Id 取得內建的 CommandBarButton 控制項的 ID。 唯讀。
Index 會取得 Long ,代表集合中 CommandBarButton 物件的索引編號。 唯讀。
IsPriorityDropped 取得 True 如果 CommandBarButton控制項目前捨棄從功能表或工具列根據流量統計資料和版面配置的空間。 (請注意這不是控制項的可見性、 Visible 屬性設為相同)。 唯讀。
Left 取得或設定指定之 CommandBarButton 控件的水準位置, (相對於螢幕左邊緣的圖元) 。 傳回停駐區域的左邊的距離。 唯讀。
Mask 取得或設定代表 CommandBarButton 物件的遮罩圖像的 IPictureDisp 物件。 遮罩圖像決定的按鈕圖像哪些部分是透明。 讀取/寫入。
OLEUsage 取得或設定 OLE 用戶端及 OLE 伺服器角色中的 CommandBarButton 控制項時將會使用合併兩個 Microsoft Office 應用程式。 可讀寫。
OnAction 取得或設定在使用者按一下或 CommandBarButton 控制項的值變更時將會執行 Visual Basic 程序名稱。 讀取/寫入。
參數 取得或設定應用程式可用來執行命令的 CommandBarButton 控制項的字串。 可讀寫。
Parent 取得 CommandBarButton 物件的 物件。 唯讀。
Picture 取得或設定代表 CommandBarButton 物件的圖像的 IPictureDisp 物件。 讀取/寫入。
優先順序 取得或設定 CommandBarButton 控制件的優先順序。 當單行命令列無法容納控制項時,控制項的優先順序會決定此控制項是否可以脫離固定的命令列。 無法容納單一列中的控制項拖關閉從右至左的命令列中。 讀取/寫入。
ShortcutText 取得或設定按鈕出現在功能表、 子功能表或快顯功能表時顯示的 CommandBarButton 控制項旁的捷徑文字。 讀取/寫入。
State 取得或設定 CommandBarButton 控制件的外觀。 讀取/寫入。
Style 取得或設定顯示 CommandBarButton 控制項的方式。 讀取/寫入。
Tag 取得或設定 CommandBarButton 控制項,例如可以做為引數的程序所使用的資料或識別之控制項的資訊的相關資訊。 讀取/寫入。
TooltipText 取得或設定 CommandBarButton 的ScreenTip 中顯示的文字。 讀取/寫入。
Top 取得從指定的 CommandBarButton 控制項上緣螢幕上緣的距離 (以像素為單位)。 唯讀。
類型 取得 CommandBarButton 控制項的類型。 唯讀。
Visible 取得或設定 CommandBarButton 控制項的 Visible 屬性。 True 是表示 如果 CommandBarButton 為可見項目。 讀取/寫入。
Width 取得或設定指定的 CommandBarButton 控制項的寬度 (以像素為單位)。 讀取/寫入。

支援和意見反應

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