CommandBarControls methods

The CommandBarControls interface supports one method, Add.

Add([variantType], [variantCmdId], [variantBefore], [variantParam])  
Returns  CommandBarControl 
Description  Creates a new CommandBarControl derived object and adds it to this collection; returns a CommandBarButton or CommandBarPopup object. The optional arguments are:
  • variantType specifies the type of CommandBarControl created. Allowed values are:
    • 1: button (the default)
    • 5: popup (menu)
  • variantCmdId is an integer that specifies a built-in command to clone; if this argument is omitted, a blank custom control of the specified type will be added to the command bar.
  • variantBefore is a number that indicates the position of the new control in the collection; the new control will be inserted before the control at this position. If this argument is omitted, the control is added at the end of the specified command bar.
  • variantParam: associates a control with a string that can be looked up with the Item property.
 
Usage 
JScript  CommandBarControls_object.Add([variantType], [variantCmdId], [variantBefore], [variantParam])  
VBScript  CommandBarControls_object.Add([variantType], [variantCmdId], [variantBefore], [variantParam]) 
Example 
// SoftQuad Script Language JSCRIPT:
var cmdBars = Application.CommandBars;
var cmdBar = cmdBars.Add("MyCommandBar");
cmdBar.Controls.Add();  // add a button
cmdBar.Controls.Add(5);  // add a command bar pop up
 


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

Copyright © SoftQuad Software Inc. 1999