Sub DisplayGeneralInfo()
Dim cb As CommandBar
For Each cb In Application.CommandBars
Debug.Print "Name:" & cb.Name
Debug.Print "Index:" & cb.Index
Debug.Print "Built In:" & cb.BuiltIn
Debug.Print "Enabled:" cb.Enabled
Debug.Print "Visible:" & cb.Visible
Debug.Print "Type:" & TranslateCommandBarType(cb.Type)
Debug.Print "Position:" & TranslateCommandBarPosition(cb.Position)
Debug.Print "Control Count:" & cb.Controls.Count
Next
End Sub
Function TranslateCommandBarPosition(vType As MsoBarPosition) As String
Dim sPosition As String
Select Case vType
Case Is = MsoBarPosition.msoBarBottom
sPosition = "Bottom"
Case Is = MsoBarPosition.msoBarFloating
sPosition = "Floating"
Case Is = MsoBarPosition.msoBarLeft
sPosition = "Left"
Case Is = MsoBarPosition.msoBarMenuBar
sPosition = "Menu Bar"
Case Is = MsoBarPosition.msoBarPopup
sPosition = "Popup"
Case Is = MsoBarPosition.msoBarRight
sPosition = "Right"
Case Is = MsoBarPosition.msoBarTop
sPosition = "Top"
Case Else
sPosition = "Unknown position"
End Select
TranslateCommandBarPosition = sPosition
End Function
Function TranslateCommandBarType(vType As MsoBarType) As String
Dim sType As String
Select Case vType
Case Is = MsoBarType.msoBarTypeMenuBar
sType = "Menu Bar"
Case Is = MsoBarType.msoBarTypeNormal
sType = "Normal"
Case Is = MsoBarType.msoBarTypePopup
sType = "Popup"
Case Else
sType = "Unknown type"
End Select
TranslateCommandBarType = sType
End Function