HoTMetaL PRO's menus, submenus, and menu items are all manipulated through the CommandBarPopup interface. You can `drill down' into the object through the Controls property.
CommandBarPopup inherits the CommandBarControl interface. In effect, a CommandBarPopup object is a CommandBarControl object for which CommandBarControl.Type is `5' (menu). It has all of the properties and methods of the generic CommandBarControl interface, in addition to its own properties.
At the top level, a CommandBarPopup represents a menu such as the File or Edit menu. Using the Controls property would return a CommandBarControls collection of all the submenus and menu items immediately under that menu.
The Controls property of a CommandBarPopup that represents a submenu returns a CommandBarControls collection that contains all the submenus and menu items in that submenu. The Controls property of a CommandBarPopup that represents a menu item would return an empty CommandBarControls collection: that is, the CommandBarControls.Count property would have a value of zero. By using the CommandBarControls.Add() method, a menu item can be changed into a submenu.
Copyright © SoftQuad Software Inc. 1999