A family of Microsoft word processing software products for creating web, email, and print documents.
All Charles and Doug say are true, but to add the button it is just a matter of:
Sub AddButtonToTextSCMenu()
Dim oBtn As CommandBarButton
'Make changes to the Add-In template
CustomizationContext = ThisDocument.AttachedTemplate
'Prevent double customization
Set oBtn = CommandBars.FindControl(Tag:="custCRBtn")
If Not oBtn Is Nothing Then oBtn.Delete
Set oBtn = CommandBars("Text").Controls.Add(msoControlButton, , , 1) 'Added to top of menu.
With oBtn
.Tag = "custCRBtn"
.FaceId = 774
.Caption = "Insert Cross Reference"
.Style = msoButtonIconAndCaption
'Identify the module and procedure to run when your button is clicked.
.OnAction = "InsertCR"
End With
If MsgBox("This action caused a change to your Add-In template." _
& vbCr + vbCr & "Recommend you save those changes now.", vbInformation + vbOKCancel, _
"Save Changes") = vbOK Then
ThisDocument.Save
End If
Set oBtn = Nothing
lbl_Exit:
Exit Sub
End Sub
Sub InsertCr()
CommandBars.ExecuteMso ("CrossReferenceInsert")
lbl_Exit:
Exit Sub
End Sub