T
tewald
This is not a cry for help, but an offer of help. For any trying to add a submenu and/or items to a menu, here's an example.
In this case, I'm adding to "Text", which is the default shortcut menu (the one that comes up when you right-click on normal text in Word). I've added a submenu ("Special Stuff"), and then 3 items within that menu. The first two just yield popups...they are there for demonstration. The last resets the menu to its original form, undoing the "damage", so to speak.
I have one routine for adding the menu, and another for adding items to that menu. I call the second from the first, using the routine names as paramaters. Feel free to change it as you see fit. Just trying to help. ;-
I hope this will be helpful. For the most part, you would just plug in your needed items
Tom Ewal
Option Explici
Dim cbMenuBar As CommandBarPopu
'Adds a submenu to the "Text" popup menu; this is the mai
'shortcut menu in Wor
'Created by Thomas F. Ewald 12/16/0
Sub AddShortcutMenu(
Set cbMenuBar = CommandBars("Text").Controls.Add(Type:=msoControlPopup
cbMenuBar.Caption = "Special Stuff
Call AddShortcutItem("Whatever"
Call AddShortcutItem("WhateverElse"
Call AddShortcutItem("ResetShortcutMenu"
End Su
'Resets "Text" to its pristine stat
Sub ResetShortcutMenu(
Application.CommandBars("Text").Rese
End Su
'Adds items to the new submen
Sub AddShortcutItem(sChoice As String
With cbMenuBa
With .Controls.Add(Type:=msoControlButton
.Caption = sChoic
.Style = msoButtonIconAndCaptio
.OnAction = sChoic
End Wit
End Wit
End Su
'Provides action for a submenu ite
Sub Whatever(
MsgBox "Whatever", , "The Whatever Box
End Su
'Provides action for a submenu ite
Sub WhateverElse(
MsgBox "Whatever Else", , "The Whatever Else Box
End Su
In this case, I'm adding to "Text", which is the default shortcut menu (the one that comes up when you right-click on normal text in Word). I've added a submenu ("Special Stuff"), and then 3 items within that menu. The first two just yield popups...they are there for demonstration. The last resets the menu to its original form, undoing the "damage", so to speak.
I have one routine for adding the menu, and another for adding items to that menu. I call the second from the first, using the routine names as paramaters. Feel free to change it as you see fit. Just trying to help. ;-
I hope this will be helpful. For the most part, you would just plug in your needed items
Tom Ewal
Option Explici
Dim cbMenuBar As CommandBarPopu
'Adds a submenu to the "Text" popup menu; this is the mai
'shortcut menu in Wor
'Created by Thomas F. Ewald 12/16/0
Sub AddShortcutMenu(
Set cbMenuBar = CommandBars("Text").Controls.Add(Type:=msoControlPopup
cbMenuBar.Caption = "Special Stuff
Call AddShortcutItem("Whatever"
Call AddShortcutItem("WhateverElse"
Call AddShortcutItem("ResetShortcutMenu"
End Su
'Resets "Text" to its pristine stat
Sub ResetShortcutMenu(
Application.CommandBars("Text").Rese
End Su
'Adds items to the new submen
Sub AddShortcutItem(sChoice As String
With cbMenuBa
With .Controls.Add(Type:=msoControlButton
.Caption = sChoic
.Style = msoButtonIconAndCaptio
.OnAction = sChoic
End Wit
End Wit
End Su
'Provides action for a submenu ite
Sub Whatever(
MsgBox "Whatever", , "The Whatever Box
End Su
'Provides action for a submenu ite
Sub WhateverElse(
MsgBox "Whatever Else", , "The Whatever Else Box
End Su