_CommandBars.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 _
) As CommandBarControl
'Usage
Dim instance As _CommandBars
Dim Type As Object
Dim Id As Object
Dim Tag As Object
Dim Visible As Object
Dim returnValue As CommandBarControl
returnValue = instance.FindControl(Type, _
Id, Tag, Visible)
CommandBarControl FindControl(
Object Type,
Object Id,
Object Tag,
Object Visible
)
Parameters
Type
Type: System.ObjectOptional MsoControlType. The type of control.
Id
Type: System.ObjectOptional Object. The identifier of the control.
Tag
Type: System.ObjectOptional Object. The tag value of the control.
Visible
Type: System.ObjectOptional 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.
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.