View Single Post
  #1  
Old 07-04-2009, 02:50 PM
tryer tryer is offline
Valued Forum Contributor
 
Join Date: 16 Nov 2004
Posts: 212
tryer is becoming part of the community
Adding sub menu's

I am using the code below which creates top level and second level menu items. What I would like to do is add third level menu items to this.
Can anyone help
Code:
   Set cbSubMenu = cbMenu.Controls.Add(msoControlPopup, 1, , , True)
    With cbSubMenu
        .Caption = "&Import/Export"
        .Tag = "SubMenu1"
        .BeginGroup = True
    End With

    ' add menuitem to submenu
    With cbSubMenu.Controls.Add(msoControlButton, 1, , , True)
        .Caption = "&Import file"
        .OnAction = "get_file"
        .Style = msoButtonIconAndCaption
        .FaceId = 71
        .State = msoButtonDown ' or msoButtonUp
    End With

    ' add menuitem to submenu
    With cbSubMenu.Controls.Add(msoControlButton, 1, , , True)
        .Caption = "&Export Data"
        .OnAction = "save_sheets_as_workbooks"
        .Style = msoButtonIconAndCaption
        .FaceId = 72
        .Enabled = True '
    End With
Reply With Quote