Visio (的 Application.CustomMenus 屬性)

取得 UIObject 物件,表示 Application 物件的 目前自訂功能表和快速鍵。 唯讀。

注意事項

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

語法

運算式CustomMenus

expression 代表 Application 物件的變數。

傳回值

UIObject

註解

如果 Microsoft Visio 功能表和快速鍵尚未以程式設計方式由 Visio 解決方案或使用者介面自訂, CustomMenus 屬性會傳回 Nothing

範例

下列 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 支援與意見反應