Application.CustomMenus 属性 (Visio)

获取一个 UIObject 对象,该对象代表 Application 对象的当前自定义菜单和快捷键。 只读。

注意

从 Visio 2010 开始,Microsoft Office Fluent 用户界面 (UI) 替换了以前的分层菜单、工具栏和任务窗格系统。 用于在以前版本的 Visio 中自定义用户界面的 VBA 对象和成员在 Visio 中仍可用,但它们的功能不同。

语法

表达式CustomMenus

expression:表示 Application 对象的变量。

返回值

UIObject

备注

如果尚未通过 Visio 解决方案以编程方式或在用户界面中自定义 Microsoft 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 支持和反馈,获取有关如何接收支持和提供反馈的指南。