J
JB
Hi Folks,
Just looking for a way to get information out of custom command bars and
the buttons related to them.
I have a few custom command bars and I'd like to know how I can get all
the info from them (possibly to re-create them on the fly)
Any pointers appreciated (excuse the test array I'll write some proper
code when I get it working
)
I started with something like this.....
Dim cb As Office.CommandBar
Dim cbutt As Office.CommandBarButton
Dim strcbname As String
Dim test(25) As String
For Each cb In CommandBars
If Not cb.BuiltIn Then
test(1) = cb.AdaptiveMenu
test(2) = cb.Application
test(3) = cb.Context
'test(4) = cb.Controls 'not working
test(5) = cb.Creator
test(6) = cb.Height
test(7) = cb.Index
test(8) = cb.Left
test(9) = cb.Name
test(10) = cb.NameLocal
test(11) = cb.Parent
test(12) = cb.Position
test(13) = cb.RowIndex
test(14) = cb.Type
test(15) = cb.Width
For Each cbutt In cb ' This is where it falls over. Don't mind
writing over array items here! Just testing in debug for now
test(1) = cbutt.Application
test(2) = cbutt.BeginGroup
test(3) = cbutt.BuiltIn
test(4) = cbutt.BuiltInFace
test(5) = cbutt.Caption
test(6) = cbutt.DescriptionText
test(7) = cbutt.FaceId
test(8) = cbutt.Height
test(9) = cbutt.ID
test(10) = cbutt.Index
test(11) = cbutt.IsPriorityDropped
test(12) = cbutt.Left
test(13) = cbutt.Mask
test(14) = cbutt.OnAction
test(15) = cbutt.Parameter
test(16) = cbutt.Picture
test(17) = cbutt.Priority
test(18) = cbutt.ShortcutText
test(19) = cbutt.State
test(20) = cbutt.Style
test(21) = cbutt.Tag
test(22) = cbutt.TooltipText
test(23) = cbutt.Top
test(24) = cbutt.Type
test(25) = cbutt.Width
Next
Next
Just looking for a way to get information out of custom command bars and
the buttons related to them.
I have a few custom command bars and I'd like to know how I can get all
the info from them (possibly to re-create them on the fly)
Any pointers appreciated (excuse the test array I'll write some proper
code when I get it working
I started with something like this.....
Dim cb As Office.CommandBar
Dim cbutt As Office.CommandBarButton
Dim strcbname As String
Dim test(25) As String
For Each cb In CommandBars
If Not cb.BuiltIn Then
test(1) = cb.AdaptiveMenu
test(2) = cb.Application
test(3) = cb.Context
'test(4) = cb.Controls 'not working
test(5) = cb.Creator
test(6) = cb.Height
test(7) = cb.Index
test(8) = cb.Left
test(9) = cb.Name
test(10) = cb.NameLocal
test(11) = cb.Parent
test(12) = cb.Position
test(13) = cb.RowIndex
test(14) = cb.Type
test(15) = cb.Width
For Each cbutt In cb ' This is where it falls over. Don't mind
writing over array items here! Just testing in debug for now
test(1) = cbutt.Application
test(2) = cbutt.BeginGroup
test(3) = cbutt.BuiltIn
test(4) = cbutt.BuiltInFace
test(5) = cbutt.Caption
test(6) = cbutt.DescriptionText
test(7) = cbutt.FaceId
test(8) = cbutt.Height
test(9) = cbutt.ID
test(10) = cbutt.Index
test(11) = cbutt.IsPriorityDropped
test(12) = cbutt.Left
test(13) = cbutt.Mask
test(14) = cbutt.OnAction
test(15) = cbutt.Parameter
test(16) = cbutt.Picture
test(17) = cbutt.Priority
test(18) = cbutt.ShortcutText
test(19) = cbutt.State
test(20) = cbutt.Style
test(21) = cbutt.Tag
test(22) = cbutt.TooltipText
test(23) = cbutt.Top
test(24) = cbutt.Type
test(25) = cbutt.Width
Next
Next