Table of contents

InvisibleApp.CustomMenus 属性 (Visio)InvisibleApp.CustomMenus Property (Visio)

office 365 dev account|上次更新日期: 2018/3/13
2 参与人员

获取一个UIObject对象,该对象表示当前自定义菜单和快捷键的InvisibleApp对象。只读的。Gets a UIObject object that represents the current custom menus and accelerators of an InvisibleApp object. Read-only.


表达式CustomMenusexpression . CustomMenus

表达式_一个表示InvisibleApp对象的变量。_expression A variable that represents an InvisibleApp object.

返回值Return Value



请注意 从 Visio,Microsoft Office 流畅的用户界面 (UI) 替换的前一个系统的分层的菜单、 工具栏和任务窗格。VBA 对象和用于自定义用户界面,在 Visio 的以前版本中的成员仍可在 Visio 中,但它们的功能有所不同。Note Starting with Visio, the Microsoft Office Fluent user interface (UI) replaces the previous system of layered menus, toolbars, and task panes. VBA objects and members that you used to customize the user interface in previous versions of Visio are still available in Visio, but they function differently.

如果 Microsoft Visio 菜单和快捷键不已自定义,以编程方式,通过一种 Visio 解决方案,或在用户界面中,则CustomMenus属性将返回NothingIf Microsoft Visio menus and accelerators have not been customized, either programmatically, by a Visio solution, or in the user interface, the CustomMenus property returns Nothing .


以下 Microsoft Visual Basic for Applications (VBA) 宏显示如何获取您的文档的当前活动用户界面 (UI) 而无需替换应用程序级的自定义 UI。您必须编写其他代码来添加您的自定义 UI 项。This Microsoft Visual Basic for Applications (VBA) macro shows how to get the currently active user interface (UI) for your document without replacing the application-level custom UI. You must write additional code to add your custom UI items.

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 


 'If there are existing Visio application-level custom menus, use them. 
 Set vsoUIObject = Visio.Application.CustomMenus 
 MsgBox "Using Custom Menus", 0 

 End If 


 'Use the existing custom menus. 
 Set vsoUIObject = ThisDocument.CustomMenus 
 MsgBox "Using Custom Menus", 0 

 End If 

End Sub
© 2018 Microsoft