Kontextmenü-Einträge
25.08.2008 08:35:00
Andreas
ich habe ein "Problem" mit meinen Kontextmenü-Einträgen. Ich kann welche hinzufügen, allerdings bekomme ich es nicht hin, dass es mir meine Einträge durch eine Trennlinie von den restlichen Einträgen trennt. Ich möchte nach meinem letzten Eintrag eine Trennlinie einbauen, aber diese wird stets VOR meinem letzten Kontextmenü-Eintrag angelegt.
Anbei mein Quellcode für das Hinzufügen (mit falscher Trennlinien-Position):
Sub AddContextCmd()
Dim cb As CommandBar
Dim ctl As CommandBarControl
Set cb = CommandBars("Cell")
Set ctl = cb.Controls.Add(before:=1)
With ctl
.Caption = "Anwesend"
.OnAction = "Anwesend"
End With
Set cb = CommandBars("Cell")
Set ctl = cb.Controls.Add(before:=2)
With ctl
.Caption = "Urlaub"
.OnAction = "Urlaub"
End With
Set cb = CommandBars("Cell")
Set ctl = cb.Controls.Add(before:=3)
With ctl
.Caption = "Krankheit"
.OnAction = "Krankheit"
End With
Set cb = CommandBars("Cell")
Set ctl = cb.Controls.Add(before:=4)
With ctl
.Caption = "Wochenende"
.OnAction = "Wochenende"
End With
Set cb = CommandBars("Cell")
Set ctl = cb.Controls.Add(before:=5)
With ctl
.BeginGroup = True
.Caption = "Abwesend"
.OnAction = "Abwesend"
End With
End Sub
Ganz edel wäre es, wenn ich eine Untergruppe einbauen könnte, die ich "Status" nenne und es mir meine Einträge in dieser Untergruppe anzeigt. Weiß jemand wie das funktioniert?
Danke im Voraus!
Mfg. Andi