Diese Dokumentation wurde archiviert und wird nicht länger gepflegt.

CommandBarControls.Add Method

Creates a new CommandBarControl object and adds it to the collection of controls on the specified command bar.

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

Dim Type As Object
Dim Id As Object
Dim Parameter As Object
Dim Before As Object
Dim Temporary As Object
Dim returnValue As CommandBarControl
Dim commandBarControls1 As CommandBarControls
returnValue = commandBarControls1.Add(Type, Id, Parameter, Before, Temporary)

CommandBarControl Add(
	[In, Optional] object Type, 
	[In, Optional] object Id, 
	[In, Optional] object Parameter, 
	[In, Optional] object Before, 
	[In, Optional] object Temporary
public CommandBarControl Add(
	/*in*/System.Object Type, 
	/*in*/System.Object Id, 
	/*in*/System.Object Parameter, 
	/*in*/System.Object Before, 
	/*in*/System.Object Temporary
function Add(
	 Type : Object, 
	 Id : Object, 
	 Parameter : Object, 
	 Before : Object, 
	 Temporary : Object
) : CommandBarControl;



Optional Object. The type of control to be added to the specified command bar. Can be one of the following MsoControlType constants: msoControlButton, msoControlEdit, msoControlDropdown, msoControlComboBox, or msoControlPopup.


Optional Object. An integer that specifies a built-in control. If the value of this argument is 1, or if this argument is omitted, a blank custom control of the specified type will be added to the command bar.


Optional Object. For built-in controls, this argument is used by the container application to run the command. For custom controls, you can use this argument to send information to procedures, or you can use it to store information about the control (similar to a second Tag property value).


Optional Object. A number that indicates the position of the new control on the command bar. The new control will be inserted before the control at this position. If this argument is omitted, the control is added at the end of the specified command bar.


Optional Object. True to make the new control temporary. Temporary controls are automatically deleted when the container application is closed. The default value is False.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms