Table of contents
TOC
折叠目录
展开目录

Document.CustomToolbars 属性 (Visio)Document.CustomToolbars Property (Visio)

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

获取一个UIObject对象,该对象表示当前自定义工具栏和状态栏的文档对象。只读的。Gets a UIObject object that represents the current custom toolbars and status bars of a Document object. Read-only.

语法Syntax

表达式CustomToolbarsexpression . CustomToolbars

表达式_一个表示文档对象的变量。_expression A variable that represents a Document object.

返回值Return Value

UIObjectUIObject

注解Remarks

请注意 从 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 解决方案,或在用户界面中,则CustomToolbars属性将返回NothingIf Microsoft Visio toolbars and status bars have not been customized, either programmatically, by a Visio solution, or in the user interface, the CustomToolbars property returns Nothing .

示例Example

以下 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 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
© 2018 Microsoft