<< Click to Display Table of Contents >> CommandBar (object) |
Access path: Application à CommandBars à Item
1 Description
A CommandBar object represents one individual toolbar in PlanMaker.
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 pm.Application.CommandBars.Item(1).Name
' The same, but easier, using the default property
MsgBox pm.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 pm.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 pm = CreateObject("PlanMaker.Application")
pm.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.