CommandBar.FindControl Method

Returns a CommandBarControl object that fits the specified criteria.

Namespace:  Microsoft.Office.Core
Assembly:  office (in office.dll)

Syntax

'Declaration
Function FindControl ( _
    Type As Object, _
    Id As Object, _
    Tag As Object, _
    Visible As Object, _
    Recursive As Object _
) As CommandBarControl
'Usage
Dim instance As CommandBar
Dim Type As Object
Dim Id As Object
Dim Tag As Object
Dim Visible As Object
Dim Recursive As Object
Dim returnValue As CommandBarControl

returnValue = instance.FindControl(Type, _
    Id, Tag, Visible, Recursive)
CommandBarControl FindControl(
    Object Type,
    Object Id,
    Object Tag,
    Object Visible,
    Object Recursive
)

Parameters

  • Id
    Type: System.Object

    Optional Object. The identifier of the control.

  • Tag
    Type: System.Object

    Optional Object. The tag value of the control.

  • Visible
    Type: System.Object

    Optional Object. True 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.

  • Recursive
    Type: System.Object

    Optional Boolean. True to include the command bar and all of its pop-up subtoolbars in the search. The default value is False.

Return Value

Type: Microsoft.Office.Core.CommandBarControl

Remarks

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

Reference

CommandBar Interface

CommandBar Members

Microsoft.Office.Core Namespace