Gruppe
Menue
Problem
Wie kann ich dem Kontextmenü eigene Schaltflächen hinzufügen?
StandardModule: basMain
Sub NewMenuItem()
Dim oBtn As CommandBarButton
On Error Resume Next
Application.CommandBars("Cell") _
.Controls("Notiz bearbeiten").Delete
On Error GoTo 0
Set oBtn = CommandBars("Cell").Controls.Add
With oBtn
.Caption = "Notiz bearbeiten"
.OnAction = "Notiz"
.Style = msoButtonCaption
End With
End Sub
Sub Notiz()
MsgBox "Ich bin die Notiz!"
End Sub
Sub CmdBarReset()
On Error Resume Next
Application.CommandBars("Cell") _
.Controls("Notiz bearbeiten").Delete
End Sub