CommandBar.InsertButton

This function adds a button to the command bar referencing the specified command.

Syntax Parameters Return Value
Function CommandBar.InsertButton( _
    Index As Integer, _
    Optional Command As CommandIdentifier = scCmdNone, _
    Optional Image As Integer = -1, _
    Optional Caption As String, _
    Optional UserImage As Boolean = False) As CommandBarItem
  • Index [in]

The position of where to place the button.

Type: Integer

  • Command [in,optional]

The command to run when the button is clicked.

Type: CommandIdentifier

Default value: scCmdNone

  • Image [in,optional]

Type: Integer

Default value: -1

  • Caption [in,optional]

The tooltip for the button.

Type: String

  • UserImage [in,optional]

Type: Boolean

Default value: False

CommandBarItem