CommandBarPopup properties

In addition to the properties it inherits from the CommandBarControl interface, the CommandBarPopup interface supports two properties, Caption and Controls.

Caption 
Access  Read/write 
Type  String 
Description  Returns or sets the menu, submenu, or menu item caption text. 
Usage 
JScript 
vbl = CommandBarPopup_object.Caption;
CommandBarPopup_object.Caption = strCaption;
 
VBScript 
vbl = CommandBarPopup_object.Caption
CommandBarPopup_object.Caption = strCaption
 
Example 
// SoftQuad Script Language JSCRIPT:
var cmdBars = Application.CommandBars;
var cmdBar = cmdBars.Add("MyCommandBar");
// add a command bar pop up
var cmdBarPopup = cmdBar.Controls.Add(5);  
// display the caption
Application.alert(cmdBarPopup.Caption);  
// change the caption
cmdBarPopup.Caption = "Change the Name";  
 

Controls 
Access  Read-only 
Type  CommandBarControls 
Description  Returns the collection of menu items in the menu or submenu. 
Usage 
JScript  CommandBarPopup_object.Controls;  
VBScript  CommandBarPopup_object.Controls 
Example 
// SoftQuad Script Language JSCRIPT:
var cmdBars = Application.CommandBars;
var cmdBar = cmdBars.item("Menu bar");
// get the "File" CommandBarPopup
var cmdBarPopup = cmdBar.Controls.item(1);  
Application.alert(cmdBarPopup.Caption); 
// This is how to obtain a collection of 
// all controls under the "File" menu item.
var commandBarControls = cmdBarPopup.Controls;   
 


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

Copyright © SoftQuad Software Inc. 1999