Ok... So I get an idea in my head and I am on . I start reading various post and KB's in VBA express and the idea evolves.
Finally, I find my self with an interesting idea BUT...
I used the KB to build a Custom Menu. However, I don't want it in the menu bar, but would rather have it as a ToolBar. So, I to the VBA Guru's and hope someone will help me see what I am missing here.
I imagine that I am looking for a CommandBar Type but am having absolutely no luck finding it.
[vba]
Sub Custom_Toolbar()
Dim Mybar As CommandBar
Dim cmd As CommandBarPopup
Dim iInt As Integer
Dim A(2) As Variant
CustomizationContext = ActiveDocument.AttachedTemplate
On Error Resume Next
'This checks if the menu already exists. If it does, it does not create a new one.
CommandBars("Menu Bar").Controls("Te&mplates").Caption = "Te&mplates"
If Not Err.Number = 0 Then
'Note that the parts of the array are ("Title of menu option", "Macro to Run", FaceID for toolbar button)
A(1) = Array("New Visit ", "NewTemplate", 18)
A(2) = Array("Save Visit ", "SaveTemplate", 3)
With CommandBars("Menu Bar").Controls
.Add(Type:=msoControlPopup, Before:=11).Caption = "Te&mplates"
End With
For iInt = 1 To UBound(A)
With CommandBars("Menu Bar").Controls("Te&mplates").Controls
Set myButton = .Add(Type:=msoControlButton)
With myButton
.Caption = A(iInt)(0)
.OnAction = A(iInt)(1)
.FaceId = A(iInt)(2)
End With
End With
Next iInt
End If
End Sub
[/vba]