CommandBar properties

The CommandBar interface supports the following properties:

BuiltIn 
Access  Read-only 
Type  Long 
Description  Returns true for a built-in toolbar, false for a custom tool bar. 
Usage   
JScript  CommandBar_object.BuiltIn;  
VBScript  CommandBar_object.BuiltIn 
Example 
// SoftQuad Script Language JSCRIPT:
// get the command bars collection
var cmdBars = Application.CommandBars;
cmdBars.Add("My Own Bar");
// get the"Standard" built-in toolbar
var cmdBar = cmdBars.item("Standard");
var customBar = cmdBars.item("My Own Bar");
Application.alert(cmdBar.BuiltIn);  // returns true
Application.alert(customBar.BuiltIn); // returns false
 

Controls 
Access  Read-only 
Type  CommandBarControls 
Description  Returns a collection of the controls (individual buttons, menu items, or submenus) on the CommandBar.  
Usage   
JScript  CommandBar_object.Controls;  
VBScript  CommandBar_object.Controls 
Example 
// SoftQuad Script Language JSCRIPT:
var cmdBars = Application.CommandBars;
// get the"Standard" built-in toolbar
var StndCmdBar = cmdBars.item("Standard");
// get the CommandBarControls object
// for the Standard menu
var stndcontrols = StndCmdBar.Controls;
 

Enabled 
Access  Read/write 
Type  Boolean 
Description  Returns or sets enable state of the CommandBar. Setting Enabled to false disables all of the controls on the toolbar, while true allows the enable state of each control to be set individually. 
Usage   
JScript 
vbl = CommandBar_object.Enabled;
CommandBar_object.Enabled = boolState;
 
VBScript 
vbl = CommandBar_object.Enabled
CommandBar_object.Enabled = boolState
 

name 
Access  Read/write 
Type  String 
Description  Returns or sets the name of the specified CommandBar object. This name is used in the HoTMetaL PRO pop-up menu of toolbars, and as the palette title if the toolbar is displayed as a floating palette. 
Usage   
JScript 
vbl = CommandBar_object.name;
CommandBar_object.name = strName
 
VBScript 
vbl = CommandBar_object.name
CommandBar_object.name = strName
 
Example 
// SoftQuad Script Language JSCRIPT:
var cmdBars = Application.CommandBars;
var cmdBar = cmdBars.item("Standard");
Application.alert(cmdBar.name);
 

Position 
Access  Read/write 
Type  Integer 
Description  Returns or sets the position of the CommandBar based upon the assigned value. The allowed values are:
  • 1: left
  • 2: top
  • 3: right
  • 4: bottom
  • 5: floating
 
Usage   
JScript 
vbl = CommandBar_object.Position;
CommandBar_object.Position = intPosition;
 
VBScript 
vbl = CommandBar_object.Position
CommandBar_object.Position = intPosition
 
Example 
// SoftQuad Script Language JSCRIPT:
var cmdBars = Application.CommandBars;
var cmdBar = cmdBars.item("Standard");
cmdBar.Position = 5; // make the standard toolbar float
 

Visible 
Access  Read/write 
Type  Boolean 
Description  Returns or sets the visibility of the CommandBar
Usage   
JScript 
vbl = CommandBar_object.Visible;
CommandBar_object.Visible = boolState;
 
VBScript 
vbl = CommandBar_object.Visible
CommandBar_object.Visible = boolState
 
Example 
// SoftQuad Script Language JSCRIPT:
var cmdBars = Application.CommandBars;
var cmdBar = cmdBars.item("My Own Bar");
cmdBar.Visible = false;  // hide the command bar
 


Right arrow
Next Topic
Left arrow
Previous Topic
Table of contents
Table of Contents

Copyright © SoftQuad Software Inc. 1999