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

CommandBar.FindControl Method (Office)

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

Gets a CommandBarControl object that fits a specified criteria.

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. FindControl( Type, Id, Tag, Visible, Recursive )

expression A variable that represents a CommandBar object.


NameRequired/OptionalData TypeDescription
TypeOptionalVariantThe type of control.
IdOptionalVariantThe identifier of the control.
TagOptionalVariantThe tag value of the control.
VisibleOptionalVariantTrue to include only visible command bar controls in the search. The default value is False. Visible command bars include all visible toolbars and any menus that are open at the time the FindControl method is executed.
RecursiveOptionalVariantTrue to include the command bar and all of its pop-up subtoolbars in the search. This argument only applies to the CommandBar object. The default value is False.

Return Value



If the CommandBars collection contains two or more controls that fit the search criteria, FindControl returns the first control that's found. If no control that fits the criteria is found, FindControl returns Nothing.

See also


CommandBar Object

Other resources

CommandBar Object Members

© 2018 Microsoft