Add entry to right mouse click dropdown

F

Frank abel

Hi
find some code below for adding an entry to the
contextmenu:

Sub Add_Item()
Dim New_Entry As Object
Set New_Entry = CommandBars("Cell").Controls.Add
(Temporary:=True)
On Error Resume Next
New_Entry.Controls("My message").Delete
On Error Goto 0

With New_Entry
.Caption = "My message"
.OnAction = "Message"
End With
End Sub


Sub Message()
MsgBox "Now you code yould start"
End Sub

Sub Delete_Item()
Dim myControl As CommandBarButton
For Each myControl In CommandBars("Cell").Controls
If myControl.Caption = "My message" Then
myControl.Delete
End If
Next
End Sub

-----Original Message-----
Is there a way to add a new entry to a right mouse click dropdown list?

When I right mouse click on a cell in the drop down list
of available commands, I want to add the command available
from the standard toolbar Insert/Name.
 
Top