Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Multi Nested Menus

I have written some code that generates a menu on the
MenuBar. Within this menu, I have a few items and one of
those items generates a popup (i.e. group = True). My
problem is that I want to embed another level into one or
more of the popup menus, and I can't seem to do it.

See below for the code.

Dim HelpMenu As CommandBarControl
Dim NewMenu As CommandBarPopup
Dim MenuItem As CommandBarControl
Dim SubMenuItem As CommandBarButton

' Delete the Menu if existing
Call DeleteMenu

' Find the Help Menu
Set HelpMenu = CommandBars(1).FindControl(ID:=30010)

If HelpMenu Is Nothing Then
' Add the Menu to the End
Set NewMenu = CommandBars(1).Controls _
.Add(Type:=msoControlPopup, Temporary:=True)
Else
' Add the menu before help
Set NewMenu = CommandBars(1).Controls _
.Add(Type:=msoControlPopup, Befo=HelpMenu.Index, _
Temporary:=True)
End If

' Add A Caption
NewMenu.Caption = "&Name"

' First Menu Item
Set MenuItem = NewMenu.Controls.Add _
(Type:=msoControlPopup, Temporary:=True)
With MenuItem
.Caption = "Engineering Forms"
.BeginGroup = True
End With


' First SubMenu Item
Set SubMenuItem = MenuItem.Controls.Add _
(Type:=msoControlButton)
With SubMenuItem
.Caption = "Release"
.OnAction = "EOR"
End With

' Second SubMenu Item
Set SubMenuItem = MenuItem.Controls.Add _
(Type:=msoControlButton)
With SubMenuItem
.Caption = "Change"
.OnAction = "EOC"
End With

' Third SubMenu Item
Set SubMenuItem = MenuItem.Controls.Add _
(Type:=msoControlButton)
With SubMenuItem
.Caption = "StockDisposition"
.OnAction = "EOS"
End With

' Fourth SubMenu Item
Set SubMenuItem = MenuItem.Controls.Add _
(Type:=msoControlButton)
With SubMenuItem
.Caption = "Bill Of Materials"
.OnAction = "EOB"
End With

' Second Menu Item
Set MenuItem = NewMenu.Controls.Add _
(Type:=msoControlButton)
With MenuItem
.Caption = "Signatures"
.BeginGroup = False
.OnAction = "Sig"

End With

' First Hyperlink Menu Item
Set MenuItem = NewMenu.Controls.Add _
(Type:=msoControlButton)
With MenuItem
.Caption = "Drawing Database"
.HyperlinkType = msoCommandBarButtonHyperlinkOpen
.TooltipText = "Hyperlink Location"
End With



End Sub
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sub-menus of main menus for Excel 2007 Eleanor Peppard New Users to Excel 1 March 16th 10 04:12 PM
multi, nested functions... G0dsg1rl Excel Discussion (Misc queries) 5 February 15th 10 04:36 PM
difference between word 2003 menus and word 2007 menus-Explain pl kali Excel Discussion (Misc queries) 1 August 29th 07 07:56 AM
New Menus - attaching but menus are reset Greegan Excel Worksheet Functions 0 November 5th 05 03:19 PM
drop-down menus and nested references LisAmardhis Excel Discussion (Misc queries) 3 April 16th 05 08:23 PM


All times are GMT +1. The time now is 10:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"