获取表示文档对象的当前自定义工具栏和状态栏的 UIObject 对象。 此为只读属性。
语法
表达式。CustomToolbars
表达式 表示 Document 对象的变量。
返回值
UIObject
备注
注意
从 Visio 2010 开始,Microsoft Office Fluent 用户界面 (UI) 取代了以前的分层菜单、工具栏和任务窗格系统。 在以前版本的 Visio 中用于自定义用户界面的 VBA 对象和成员在 Visio 中仍然可用,只是它们的功能有所不同。
如果 Microsoft Visio 工具栏和状态栏尚未通过 Visio 解决方案以编程方式或在用户界面中自定义,则 CustomToolbars 属性将不返回 任何内容。
示例
以下 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 支持和反馈,获取有关如何接收支持和提供反馈的指南。