View Single Post
 
Old 08-28-2014, 09:54 AM
rjrichar40 rjrichar40 is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Aug 2014
Posts: 11
rjrichar40 is on a distinguished road
Default Adding a pop-up (cascading) menu to existing commandbar

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?
Reply With Quote