ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding items to right-click menu (https://www.excelbanter.com/excel-programming/370406-adding-items-right-click-menu.html)

Cumberland[_7_]

Adding items to right-click menu
 

Hi.

I have written a short macro to add items to the right-click menu, bu
am having difficulty finding the right ID numbers. So far, I hav
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 m
what they are?

Thanks

--
Cumberlan
-----------------------------------------------------------------------
Cumberland's Profile: http://www.excelforum.com/member.php...fo&userid=3344
View this thread: http://www.excelforum.com/showthread.php?threadid=57171


Simon Lloyd[_874_]

Adding items to right-click menu
 

Maybe this link will help with the ID's

Regards,
Simon

http://support.microsoft.com/?kbid=830502


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=571718


Simon Lloyd[_875_]

Adding items to right-click menu
 

The last link may be useful but this one has all the ID's for exce
2000

Regards,
Simon

http://support.microsoft.com/kb/213552/EN-US

--
Simon Lloy
-----------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670
View this thread: http://www.excelforum.com/showthread.php?threadid=57171


Cumberland[_8_]

Adding items to right-click menu
 

Thanks Simon, much appreciated, but unfortunately they haven't answered
my question.

You'll notice that the ID numbers I already have, 369 and 370, aren't
actually listed in the ID numbers link, so what I really need are
absolutely EVERY single ID number possible and what they do. I've had a
scan around Microsoft's website, but they aren't there.

I could try going through every ID in the macro until I find the right
ones, but that could take a LONG time!!!


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


Simon Lloyd[_879_]

Adding items to right-click menu
 

Sorry thats the best i could do, perhaps send mail to microsoft and
ask?

Worth a go!

Regards,
Simon


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=571718


RB Smissaert

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



RB Smissaert

Adding items to right-click menu
 
Sorry, ignore this message. I realize you are dealing with built-in actions
where this is different.
Still, maybe you could make macro's that do these built-in actions and do it
as posted.

RBS

"RB Smissaert" wrote in message
...
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




NickHK[_3_]

Adding items to right-click menu
 
You can generate all the data yourself. depending exactly what you need,
something aloong these lines:
Private Sub CommandButton1_Click()
Dim cmdBar As CommandBar
Dim cmdBarCtrl As CommandBarControl

For Each cmdBar In CommandBars
Debug.Print cmdBar.Index, cmdBar.Name
For Each cmdBarCtrl In cmdBar.Controls
Debug.Print , cmdBarCtrl.ID, cmdBarCtrl.Caption
Next
Next
End Sub

NickHK

"Cumberland" ¼¶¼g©ó¶l¥ó·s»D:Cumberland.2ckwrq_1155641109.3903@e xcelforum-nospam.com...

Thanks Simon, much appreciated, but unfortunately they haven't answered
my question.

You'll notice that the ID numbers I already have, 369 and 370, aren't
actually listed in the ID numbers link, so what I really need are
absolutely EVERY single ID number possible and what they do. I've had a
scan around Microsoft's website, but they aren't there.

I could try going through every ID in the macro until I find the right
ones, but that could take a LONG time!!!


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




Ron de Bruin

Adding items to right-click menu
 
See
http://www.rondebruin.nl/menuid.htm

Read this part about the ID's
http://www.rondebruin.nl/menuid.htm#ID


--
Regards Ron de Bruin
http://www.rondebruin.nl



"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





All times are GMT +1. The time now is 08:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com