Add Method (CommandBarControls Collection) Example

This example creates a custom editing toolbar that contains buttons (controls) for cutting, copying, and pasting.

Dim customBar As CommandBar
Dim newButton As CommandBarButton
Set customBar = CommandBars.Add("Custom")
Set newButton = customBar.Controls _
    .Add(msoControlButton, CommandBars("Edit") _
    .Controls("Cut").Id)
Set newButton = customBar.Controls _
    .Add(msoControlButton, CommandBars("Edit") _
    .Controls("Copy").Id)
Set newButton = customBar.Controls _
    .Add(msoControlButton, CommandBars("Edit") _
    .Controls("Paste").Id)
customBar.Visible = True