Hi Merlin,
I understand that you mean the Text menu as below.
Text
--------Cu&t
--------&Copy
--------&Paste
--------Delete Co&mment
--------Recon&vert
--------&Font...
--------&Paragraph...
--------Bullets and &Numbering...
--------Te&xt Direction...
--------&Symbol...
--------&Hyperlink...
--------&Who Is...
--------Loo&k Up...
--------&Define
--------S&ynonyms
--------Tr&anslate
--------&Select Text with Similar Formatting
So that we can use the code below to add another new button
Sub Test()
Dim cb As CommandBarButton
Set cb = Application.CommandBars("Text").Controls.Add
cb.Caption = "Testafasfasfasdf"
End Sub
Also you may run the code below to get a list of available Word's
commandbars/buttons.
Sub TestButtons()
Dim fso As New Scripting.FileSystemObject
Dim ts As Scripting.TextStream
Set ts = fso.CreateTextFile("C:\WordCommandBars.txt", True, True)
Dim cb As CommandBar
Dim cbc As CommandBarControl
For Each cb In CommandBars
ts.Write cb.Name & vbCrLf
For Each cbc In cb.Controls
ts.Write "--------" & cbc.Caption & vbCrLf
Next
Next
ts.Close
End Sub
It will generate a text file C:\WordCommandBars.txt.
Best regards,
Perter Huang
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.