CommandBars (collection)

<< Click to Display Table of Contents >>

CommandBars (collection)

Access path: Application à CommandBars

 1  Description

The CommandBars collection contains all of TextMaker's toolbars. The individual elements of this collection are of the type CommandBar.

Note: Toolbars work only in classic mode. They do not work with ribbons.

 2  Access to the collection

There is exactly one instance of the CommandBars collection during the whole runtime of TextMaker. It is accessed through Application.CommandBars:

' 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:

Count R/O

DisplayFonts

DisplayTooltips

 

Objects:

Item CommandBar (default object)

Application Application

Parent Application

Count (property, R/O)

Data type: Long

Returns the number of CommandBar objects in the collection, i.e. the number of toolbars available.

Note: Toolbars work only in classic mode. They do not work with ribbons.

DisplayFonts (property)

Data type: Boolean

Gets or sets the setting "Show fonts in font lists" (True or False).

DisplayTooltips (property)

Data type: Boolean

Gets or sets the setting whether a tooltip should be displayed when the mouse cursor is pointed to a toolbar button. Corresponds to the setting "Show tooltips" in the dialog box of PlanMaker's ribbon command Files | Options.

Item (pointer to object)

Data type: Object

Returns an individual CommandBar object that you can use to access an individual toolbar.

Note: Toolbars work only in classic mode. They do not work with ribbons.

Which CommandBar object you get depends on the value that you pass to Item. You can specify either the numeric index or the name of the desired toolbar. Examples:

' Make the first toolbar invisible

tm.Application.CommandBars.Item(1).Visible = False

 

' Make the toolbar named "Formatting" invisible

tm.Application.CommandBars.Item("Formatting").Visible = False

Note: It is not advisable to hard-code the names of toolbars in your program, since these names are different in each language that TextMaker's user interface supports. For example, if the user interface language is set to German, the name of the "Formatting" toolbar changes to "Format".

Instead, it is recommended to use the following symbolic constants for toolbars:

tmBarStatusShort       = 1  ' Status bar (no documents open)

tmBarStandardShort     = 2  ' Standard toolbar (no documents open)

tmBarStatus            = 3  ' Status bar

tmBarStandard          = 4  ' Standard toolbar

tmBarFormatting        = 5  ' Formatting toolbar

tmBarOutliner          = 6  ' Outliner toolbar

tmBarObjects           = 7  ' Objects toolbar

tmBarFormsEditing      = 8  ' Forms toolbar

tmBarMailMerge         = 9  ' Mail merge toolbar

tmBarDatabase          = 10 ' Database toolbar

tmBarDatabaseStatus    = 11 ' Status bar (in database windows)

tmBarTable             = 12 ' Table toolbar

tmBarStatistics        = 13 ' Statistics toolbar

tmBarPicture           = 14 ' Graphics toolbar

tmBarReviewing         = 16 ' Reviewing toolbar

tmBarHeaderAndFooter   = 17 ' Header and footer toolbar

tmBarFullscreen        = 19 ' Full screen toolbar

Application (pointer to object)

Data type: Object

Returns the Application object.

Parent (pointer to object)

Data type: Object

Returns the parent object, i.e. Application.