'****************************************************************
' This procedure creates a new toolbar.
'****************************************************************
Public Sub AddPrintCommandBar()
Dim CBar As CommandBar
Dim CBarCtl As CommandBarControl
On Error GoTo AddNewCB_Err
' Create a new floating toolbar and make it visible.
Set CBar = CommandBars.Add(Name:="Print Options", _
Position:=msoBarFloating, MenuBar:=False, Temporary:=True)
CBar.Visible = True
With CBar
' Create the buttons.
Set CBarCtl = .Controls.Add(msoControlButton, CommandBars("File") _
.Controls("Page Setup...").ID)
.Controls(1).Style = msoButtonIconAndCaption
Set CBarCtl = .Controls.Add(msoControlButton, CommandBars("File") _
.Controls("Save As...").ID)
.Controls(2).Style = msoButtonIconAndCaption
Set CBarCtl = .Controls.Add(msoControlButton, CommandBars("File") _
.Controls("Export...").ID)
.Controls(3).Style = msoButtonIconAndCaption
.Controls(3).Caption = "Export..."
Set CBarCtl = .Controls.Add(msoControlButton, CommandBars("File") _
.Controls("Print...").ID)
.Controls(4).Style = msoButtonIconAndCaption
.Controls(4).OnAction = "ReportPrint"
End With
Exit Sub
AddNewCB_Err:
MsgBox "Error " & Err.Number & vbCr & Err.Description
Exit Sub
End Sub