Long time viewer, first time poster. I have a form with Right-Click functions that work fine. I'm trying to add a sub menu to the main right-click menu to separate some functions/command. I need/want to insert the section where the 'Select Case' is, however, its only showing the top menu. Not sure where to go from here. Any help would be awesome
Thanks :)
P.S. I would be happy to explain further if needed.
Sub fzCopyPaste(iItems As Integer)
On Error Resume Next
CommandBars("Custom").Delete
Set PopBar = CommandBars.Add(Name:="Custom", Position:=msoBarPopup, MenuBar:=False, Temporary:=True)
'Add top_menu on Main Popbar : This work fine
Set top_menu = PopBar.Controls.Add(Type:=msoControlButton)
With top_menu
'.FaceId =
.Caption = "&Some Commands"
End With
Need to Insert the below sub menu(s) into the top menu But nothing shows up : Does not work
Select Case iItems
Case 1 ' Copy and Paste
Set copy_button = top_menu.Controls.Add(Type:=msoControlButton)
With copy_button
.FaceId = 19
.Caption = "&Copy"
.Tag = "tCopy"
.OnAction = "fzCopyOne(true)"
End With
Set paste_button = top_menu.Controls.Add(Type:=msoControlButton)
With paste_button
.FaceId = 22
.Tag = "tPaste"
.Caption = "&Paste"
.OnAction = "fzCopyOne(true)"
End With
Case 2 ' Paste Only
Set paste_button = top_menu.Controls.Add(Type:=msoControlButton)
With paste_button
.FaceId = 22
.Tag = "tPaste"
.Caption = "&Paste"
.OnAction = "fzCopyOne(true)"
End With
End Select
'Extra top menue(s) below here : This work fine
Set paste_button = PopBar.Controls.Add(Type:=msoControlButton)
With paste_button
.FaceId = 22
.Tag = "tPaste"
.Caption = "Main POP BAR 2"
.OnAction = "fzCopyOne(true)"
End With
PopBar.ShowPopup
CommandBars("Custom").Delete
End Sub