<< Click to Display Table of Contents >> CommandBar (object) |
Access path: Application à CommandBars à Item
1 Description
A CommandBar object represents one individual toolbar of TextMaker.
An individual CommandBar object exists for each toolbar. If you create new toolbars or delete them, the respective CommandBar objects will be created or deleted dynamically.
Note: Toolbars work only in classic mode. They do not work with ribbons.
2 Access to the object
The individual CommandBar objects can be accessed solely through enumerating the elements of the Application.CommandBars collection. The type of this collection is CommandBars.
Example:
' Show the name of the first toolbar
MsgBox tm.Application.CommandBars.Item(1).Name
' The same, but easier, using the default property
MsgBox tm.CommandBars(1)
3 Properties, objects, collections and methods
Properties:
▪Name (default property)
▪Visible
Objects:
▪Application → Application
▪Parent → CommandBars
Name (property)
Data type: String
Gets or sets the name of the toolbar.
Note: Toolbars work only in classic mode. They do not work with ribbons.
Example:
' Show the name of the first toolbar
MsgBox tm.Application.CommandBars.Item(1).Name
Visible (property)
Data type: Boolean
Gets or sets the visibility of the toolbar.
Note: Toolbars work only in classic mode. They do not work with ribbons.
The following example makes the "Formatting" toolbar invisible:
Sub Example()
Set tm = CreateObject("TextMaker.Application")
tm.Application.CommandBars.Item("Formatting").Visible = False
End Sub
Application (pointer to object)
Data type: Object
Returns the Application object.
Parent (pointer to object)
Data type: Object
Returns the parent object, i.e. CommandBars.