Page 392 - Microsoft Office Excel 2003 Programming Inside Out
P. 392

Part 5:  Manipulating Excel Objects
                                        Microsoft Office Excel 2003 Programming Inside Out

                    CommandBars Collection
                             The CommandBars collection contains all the command bars defined in Excel. For the most
                             part, the CommandBars collection is just a normal collection with properties and methods
                             such as Item, Count, and Add. However, it also has some properties that determine how the
                             command bars operate, including enabling or disabling features such as adaptive menus,
                             menu customization, and menu animation.

                             Table 17-1 contains a list of the key properties and methods of the CommandBars collection.
                             Table 17-1.  Key Properties and Methods of the CommandBars Collection
                             Property/Method          Description
                             AdaptiveMenus	           Property: when True, means that adaptive menus will be
                                                      used in Excel.
                             Add(Name, Position,      Method: creates a new command bar object and adds it to
                             MenuBar, Temporary)      CommandBars. Name is the name of the new command bar,
                                                      Position specifies where the command bar is located,
                                                      MenuBar, when True, means that the command bar replaces
                                                      the currently active menu bar. Temporary, when True, means
                                                      that the command bar will be automatically deleted when
                                                      Excel ends.
                             Count	                   Property (read-only): returns the number of CommandBars in
                                                      the collection.
                             DisableCustomize	        Property: when True, means that command bars may not be
                                                      customized by the user.
                             FindControl(Type, Id, Tag,   Method: returns an object reference to the
                             Visible, Recursive)      CommandBarControl object that matches the specified
                                                      criteria. Type specifies the type of control using the
                                                      MsoControlType enumeration. Id specifies the name of the
                                                      control. Tag searches for matches using the control’s Tag
                                                      property. Visible, when True, limits the search to only those
                                                      controls that are visible; Recursive, when True, searches
                                                      through the current CommandBar object and all of its pop-up
                                                      subtoolbars.
                             Item(Index)              Property: returns the command bar object specified by Index.
             Chapter 17
                             LargeButtons	            Property: when True, means that toolbar buttons will be
                                                      displayed larger than normal.
                             MenuAnimationStyle	      Property: specifies how the command bar is animated.
                                                      Can specify one of the following: msoMenuAnimationNone,
                                                      msnMenuAnimationRandom, msoMenuAnimationSlide, or
                                                      msoMenuAnimationUnfold.





                366
   387   388   389   390   391   392   393   394   395   396   397