View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
RB Smissaert RB Smissaert is offline
external usenet poster
 
Posts: 2,452
Default Adding items to right-click menu

You don't need any ID's to add to the right-click menu:

With Application.CommandBars("Cell")
With .Controls.Add(Type:=msoControlButton)
.BeginGroup = True
.Caption = "Change text to numbers in selected sheet range"
.OnAction = "MakeNumbers"
.FaceId = 399
End With
With .Controls.Add(Type:=msoControlButton)
.Caption = "Change formula's to values"
.OnAction = "FormulasToValues"
.FaceId = 385
End With
End With

etc.

RBS


"Cumberland" wrote
in message ...

Hi.

I have written a short macro to add items to the right-click menu, but
am having difficulty finding the right ID numbers. So far, I have
managed to add "Paste Values" and "Paste Formatting", as below:

Sub AddItems()

'Paste Values
Application.CommandBars("cell").Controls.Add Type:=msoControlButton,
ID:=370, befo=5

'Paste Formatting
Application.CommandBars("cell").Controls.Add Type:=msoControlButton,
ID:=369, befo=5

End Sub

I also want to add the following:


- Paste Formulas
- Paste Comments


But I don't know the relevant ID numbers! Please can anyone tell me
what they are?

Thanks!


--
Cumberland
------------------------------------------------------------------------
Cumberland's Profile:
http://www.excelforum.com/member.php...o&userid=33445
View this thread: http://www.excelforum.com/showthread...hreadid=571718