Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Danielle Daniels   on Jan 28 In MS Office Category.

  
Question Answered By: Melissa King   on Jan 28

To find out if the Command Bar exists, try:
For Each bar In Application.CommandBars
If bar.name = "My New Bar" Then
MsgBox "Menu Bar Exists: " & bar.Left _
& ", Width: " & bar.Width
If Not bar.Visible Then
bar.Visible = True
bar.Enabled = True
End If
Exit For
End If
Next
If the Tool Bar exists, but is not visible, it turns it on.

To make sure the most recent Command bar is available, I define it in
the Auto_Open sub of the file
'------------------------------------------------------
CMDbarName = "My New Bar"
Application.CommandBars(CMDbarName).Delete
'-------------------------------------------------------
' Create Command BAR
'-------------------------------------------------------
Set cComm = Application.CommandBars.Add
With cComm
.name = CMDbarName
.Position = msoBarTop
.RowIndex = msoBarRowFirst + 20
.Left = 600
.Visible = True
End With
'*******************************************************
'-------------------------------------------------------
' Open Tool Layouts
'-------------------------------------------------------
With cComm.Controls.Add(Type:=msoControlButton)
.Caption = "Open Document"
.Style = msoButtonIcon
.FaceId = 23
.OnAction = "Open_New_Document"
End With

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Custom Toolbars Usable by any User Or get search suggestion and latest updates.


Tagged: