Edytuj

Udostępnij za pośrednictwem


CommandBar.FindControl(Object, Object, Object, Object, Object) Method

Definition

Returns a CommandBarControl object that fits the specified criteria.

public Microsoft.Office.Core.CommandBarControl FindControl (object Type, object Id, object Tag, object Visible, object Recursive);
abstract member FindControl : obj * obj * obj * obj * obj -> Microsoft.Office.Core.CommandBarControl
Public Function FindControl (Optional Type As Object, Optional Id As Object, Optional Tag As Object, Optional Visible As Object, Optional Recursive As Object) As CommandBarControl

Parameters

Type
Object

Optional MsoControlType. The type of control.

Id
Object

Optional Object. The identifier of the control.

Tag
Object

Optional Object. The tag value of the control.

Visible
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
Object

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

Returns

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.

Applies to