Table of contents
TOC
Collapse the table of content
Expand the table of content

Application.CommandBars Property (Project)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Gets a CommandBars collection that represents all the command bars in the application. Read-only CommandBars.

Syntax

expression. CommandBars

expression A variable that represents an Application object.

Remarks

For more information, see see the CommandBars collection object in the Microsoft Office Visual Basic Reference.

Example

The following example deletes all custom command bars that aren't visible.

Sub RemoveCommandBars() 
 Dim Bar As CommandBar 

 For Each Bar In Application.CommandBars 
 If Not Bar.BuiltIn And Not Bar.Visible Then Bar.Delete 
 Next 

End Sub
© 2018 Microsoft