Name of Text-Box Right-Click Command Bar?

G

Guest

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!
 
R

Ron de Bruin

Hi Altamont

I think you are looking for

With Application.CommandBars("ActiveX Control")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top