This is probably a very noobie question, but I am trying to find sample code for adding a msoControlPopup to an existing Pop-up. In orderwords, a 3rd level. I am not sure how the previous programmer created the custom menu, and most of the example I have search for haven't been helping me.
I am guessing it is something like this:
Code:
Set CB = ActiveDocument.CommandBars("TEST")
For Each CBCtrl In CB.Controls
If CBCtrl.Type = msoControlPopup Then
Set CBP = CB.Controls(CBCtrl.Index)
For Each CBCtrl2 In CBP.Controls
If CBCtrl2.Caption = "Extend Here" Then
' create the new sub-popups
With CBCtrl2
Set menuItem = newMenu.Controls.Add(Type:=msoControlPopup)
menuItem.Caption = "Sub Menus"
End With
End If
... and then the rest goes on from there.
And ideas where I am going wrong here?