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

CommandBar.Name Property (Office)

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

Gets the name of the built-in CommandBar object. Read-only.

Note The use of CommandBars in some Microsoft Office applications has been superseded by the new ribbon component of the Microsoft Office Fluent user interface. For more information, search Help for the keyword "ribbon."


expression. Name

expression A variable that represents a CommandBar object.


The local name of a built-in command bar is displayed in the title bar (when the command bar isn't docked) and in the list of available command bars — wherever that list is displayed in the container application. For a built-in command bar, the Name property returns the command bar's U.S. English name. Use the NameLocal property to return the localized name. If you change the value of the LocalName property for a custom command bar, the value of Name changes as well, and vice versa.


This example searches the collection of command bars for the command bar named "Custom." If this command bar is found, the example makes it visible.

foundFlag =  False 
For Each bar In CommandBars 
    If bar.Name = "Custom" Then 
        foundFlag = True  
        bar.Visible = True  
    End If 
If Not foundFlag Then 
    MsgBox "'Custom' bar isn't in collection." 
    MsgBox "'Custom' bar is now visible." 
End If

See also


CommandBar Object

Other resources

CommandBar Object Members

© 2018 Microsoft