會取得一個 UIObject 物件,代表 文件物件目前 的自訂選單與加速器。 唯讀。
語法
表情。自訂選單
詞 一個代表 文件 物件的變數。
傳回值
UIObject
註解
注意事項
自 Visio 2010 起,Microsoft Office Fluent 使用者介面 (介面) 取代了先前分層選單、工具列與工作窗格的系統。 你在先前版本 Visio 中用來自訂使用者介面的 VBA 物件和成員仍然可以在 Visio 中使用,但它們的運作方式不同。
如果 Microsoft Visio 選單和加速器未經程式化、Visio 解決方案或使用者介面自訂, CustomMenus 屬性則不會回傳 任何東西。
範例
這本Microsoft Visual Basic for Applications (VBA) 巨集 展示了如何在不替換應用程式層級自訂 UI 的情況下,取得目前啟用的使用者介面 (UI) 。 你必須撰寫額外的程式碼來新增自訂的 UI 項目。
Sub CustomMenus_Example()
Dim vsoUIObject As Visio.UIObject
'Check whether there are custom menus bound to the document.
If ThisDocument.CustomMenus Is Nothing Then
'If not, check whether there are custom menus bound to the application.
If Visio.Application.CustomMenus Is Nothing Then
'If not, use the Visio built-in menus.
Set vsoUIObject = Visio.Application.BuiltInMenus
MsgBox "Using Built-In Menus", 0
Else
'If there are existing Visio application-level custom menus, use them.
Set vsoUIObject = Visio.Application.CustomMenus
MsgBox "Using Custom Menus", 0
End If
Else
'Use the existing custom menus.
Set vsoUIObject = ThisDocument.CustomMenus
MsgBox "Using Custom Menus", 0
End If
End Sub
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。