Visio) (Document.CustomToolbars 屬性

取得 UIObject 物件,代表 Document 物件目前的自訂工具列和狀態列。 唯讀。

語法

運算式。自訂工具列

運算式 代表 Document 物件的變數。

傳回值

UIObject

註解

注意事項

從 Visio 2010 開始,Microsoft Office Fluent 使用者介面 (UI) 取代先前的多層式功能表、工具列和工作窗格系統。 您在舊版 Visio 中用來自訂使用者介面的 VBA 物件和成員在 Visio 中仍然可用,但功能不同。

如果尚未自訂 Microsoft Visio 工具列和狀態列,無論是以程式設計方式、Visio 解決方案還是在使用者介面中自訂, CustomToolbars 屬性都會傳回 Nothing。

範例

此Microsoft Visual Basic for Applications (VBA) 巨集 說明如何取得目前使用中的使用者介面 (UI 的文件) ,而不取代應用程式層級的自訂 UI。 您必須撰寫其他程式碼才能新增自訂 UI 項目。

Sub CustomToolbars_Example() 
 
 Dim vsoUIObject As Visio.UIObject 
 
 'Check whether there are custom toolbars bound to the document. 
 If ThisDocument.CustomToolbars Is Nothing Then 
 
 'If not, check whether there are custom toolbars bound to the application. 
 If Visio.Application.CustomToolbars Is Nothing Then 
 
 'If not, use the Visio built-in toolbars. 
 Set vsoUIObject = Visio.Application.BuiltInToolbars(0) 
 MsgBox "Using Built-In Toolbars", 0 
 
 Else 
 
 'If there are existing Visio application-level custom toolbars, use them. 
 Set vsoUIObject = Visio.Application.CustomToolbars 
 MsgBox "Using Custom Toolbars", 0 
 
 End If 
 
 Else 
 
 'Use the existing custom toolbars. 
 Set vsoUIObject = ThisDocument.CustomToolbars 
 MsgBox "Using Custom Toolbars", 0 
 
 End If 
 
End Sub

支援和意見反應

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