I have a Word VBA Template that accomodates Old and New Versions. Posted below accomodates the old style. The new one is an Add In that works fine as well. The problem is simply that the customized menus work when right clicking outside an inserted table but not when right clicking inside it. PS: I actually don't think posting this code is really necessary because It seems that customized menus don't work inside a table.
Public Sub BuildCustomMenus2()
On Error Resume Next
With Application.CommandBars("Menu Bar")
.Controls("rate1").Delete
End With
Dim aVal As Single
aVal = ToDoubleFromString(Application.Version)
If aVal < 12 Or Trim$(GetSetting("rate1", "Narrative Software", "NoWordRibbon")) = "Yes" Then
If ThisDocument.Application.Windows.count > 0 Then SetN1Defaults
Dim vCtrlCount As Integer
Dim ctrlControl As CommandBarControl
'delete any previously created custom toolbars and rebuild
On Error Resume Next
With Application.CommandBars("Menu Bar")
.Controls("rate1").Delete
End With
vCtrlCount = CommandBars("Menu Bar").Controls.count
vCtrlCount = vCtrlCount + 1
With CommandBars("Menu Bar").Controls
.Add(Type:=msoControlPopup, BEFORE:=vCtrlCount).Caption = "&rate1"
End With
'add more macros to options here...and create
'sub...add to select case statement
'1. Add the buttons
'2. title caption
'3. Display only the caption text
'4. call procedure to pass button call
Set ctrlControl = CommandBars("Menu Bar").Controls("rate1").Controls.Add(msoControlButton)
ctrlControl.Caption = "Navigate"
ctrlControl.Style = msoButtonIconAndCaption
ctrlControl.OnAction = "RunDocMap"
ctrlControl.FaceId = 1714
Set ctrlControl = CommandBars("Menu Bar").Controls("rate1").Controls.Add(msoControlButton)
ctrlControl.Caption = "Mark Active Edit"
ctrlControl.Style = msoButtonIconAndCaption
ctrlControl.OnAction = "MarkActiveEdit"
ctrlControl.FaceId = 279
Set ctrlControl = CommandBars("Menu Bar").Controls("rate1").Controls.Add(msoControlButton)
ctrlControl.Caption = "Go to Active Edit"
ctrlControl.Style = msoButtonIconAndCaption
ctrlControl.OnAction = "GoToActiveEdit"
ctrlControl.FaceId = 39
End Sub