customize right-click menu


Posted by Stephen Toth on December 09, 2000 8:12 AM

How do I add things to the right-click menu. I specifically want to add "paste values"
I know how to add it to the edit menu, I just don't know how to get it into the right-click menu

Posted by Ivan Moala on December 09, 2000 11:19 AM

The right click option is avail via the
commandbars("Cell") eg.

Sub Cell_RightClick_ShortcutSub_Create()
Dim newSubItem As Object

CommandBars("Cell").Controls.Add(Type:=msoControlPopup, before:=1).Caption = "NewSub"
Set newSubItem = CommandBars("Cell").Controls("NewSub")
With newSubItem
.Controls.Add(Type:=msoControlButton, before:=1).Caption = "subItem1"
' This will run the subItem1_Code macro when subItem1 is clicked.
.Controls("subItem1").OnAction = "subItem1_Code"
End With

End Sub


'The following is the macro that runs when you click subItem1:
Sub subItem1_Code()
MsgBox "you clicked subItem1"
End Sub


HTH

Ivan



Posted by Stephen Toth on December 10, 2000 6:59 PM

Hi Ivan,
Thanks for the respnse, however, I was looking for a non-VBA solution.
Something more on the order of a "tools" operation