I think this might help you :)
Okay - it looks like one of your problems is one i've had myself.
[vba]
'<>
Dim myMenuName As String 'If you name your menu its easier to delete
'<>
Dim ShortCutMenu As CommandBar
Dim Menu As CommandBarPopup
Dim ctrl As CommandBarControl
'If Selection.Font.Underline = wdUnderlineWavy Then
myMenuName = "My Custom Menu"
Set ShortCutMenu = CommandBars("text")
' Set Menu = ShortCutMenu.Controls.Add(Type:=msoControlPopup, 'temporary:=True)
'<>
'Change Set statement to include toolbars name
Set Menu = ShortCutMenu.Controls.Add(Name:= myMenuName,
Type:=msoControlPopup, Temporary:=True)
' <>
With Menu
.BeginGroup = True
.Caption = "&GaelScr?obh"
' .OnAction = "AccessThesaurusMenu"
End With
System.Cursor = wdCursorWait
'Set Menu = CommandBars.ActionControl
With Selection
.Expand wdWord ' Select insertion point word.
' Deselect any trailing spaces.
Do While Right(.Text, 1) = Chr(32)
.MoveLeft Unit:=wdCharacter, _
Count:=1, Extend:=wdExtend
Loop
selWord$ = Trim(.Text) ' Store selection.
MsgBox selWord$
End With
'<>
On Error Resume Next
Application.CommandBars(MenuName).Delete
'This little piece checks that you toolbar doesnt exist already,
'if it does it deletes it if it does
'<>
Menu.delete '<- so this is no longer neccessary
[/vba]