![]() |
Name of Text-Box Right-Click Command Bar?
The following macro inserts two new selections to the menu which appears when
you right-click on a worksheet: Sub Add_Controls() Dim i As Long Dim onaction_names As Variant Dim caption_names As Variant onaction_names = Array("InputMacro", "RegroupObjects") caption_names = Array("WORKDAY Edit", "Restore Project Info Boxes") With Application.CommandBars("Cell") For i = LBound(onaction_names) To UBound(onaction_names) With .Controls.Add(Type:=msoControlButton) .OnAction = ThisWorkbook.Name & "!" & onaction_names(i) .Caption = caption_names(i) End With Next i End With End Sub I'd like the same two selections to appear on the right-click menu which appears when you are working in a text box, too. Can anyone tell me what the name or index number is of the command bar which appears when you right-click a text box? Thanks in advance! |
Name of Text-Box Right-Click Command Bar?
Hi Altamont
I think you are looking for With Application.CommandBars("ActiveX Control") -- Regards Ron de Bruin http://www.rondebruin.nl "Altamont" wrote in message ... The following macro inserts two new selections to the menu which appears when you right-click on a worksheet: Sub Add_Controls() Dim i As Long Dim onaction_names As Variant Dim caption_names As Variant onaction_names = Array("InputMacro", "RegroupObjects") caption_names = Array("WORKDAY Edit", "Restore Project Info Boxes") With Application.CommandBars("Cell") For i = LBound(onaction_names) To UBound(onaction_names) With .Controls.Add(Type:=msoControlButton) .OnAction = ThisWorkbook.Name & "!" & onaction_names(i) .Caption = caption_names(i) End With Next i End With End Sub I'd like the same two selections to appear on the right-click menu which appears when you are working in a text box, too. Can anyone tell me what the name or index number is of the command bar which appears when you right-click a text box? Thanks in advance! |
All times are GMT +1. The time now is 11:02 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com