ich habe ein Problem mit einer veränderten Office-Umgebung. In Outlook läuft bei mir ein Makro, welches mit Programmstart im Ordner "Add-Ins" eigene Symbole erstellt. Das funtkionierte bisher. Jetzt wurde aber Office auf 2013 erweitert und mein Code funktioniert nicht mehr:
Sub Leiste_erstellen()
Dim oExp As Outlook.Explorer
Dim oBar As Office.CommandBar
Dim myControl As CommandBarButton
Set oExp = Outlook.ActiveExplorer
Set oBar = oExp.CommandBars.Item("Standard")
Set myControl = oBar.FindControl(, , "Neue Mail")
If myControl Is Nothing Then
Set myControl = oBar.Controls.Add(, , , 2, True)
With myControl
.Caption = settings(17)
.FaceId = 700
.Style = msoButtonIconAndCaption
.Tag = "Neue Mail"
.OnAction = CITRIX & "1.Mailprogramm.Mail1"
.BeginGroup = True
.Visible = True
End With
End If
Set myControl = oBar.FindControl(, , "Allen antworten")
If myControl Is Nothing Then
Set myControl = oBar.Controls.Add(, , , 3, True)
With myControl
.Caption = settings(18)
.FaceId = 2604
.Style = msoButtonIconAndCaption
.Tag = "Allen antworten"
.OnAction = CITRIX & "1.Mailprogramm.Mail2"
.Visible = True
End With
End If
Set myControl = oBar.FindControl(, , "Weiterleiten")
If myControl Is Nothing Then
Set myControl = oBar.Controls.Add(, , , 4, True)
With myControl
.Caption = settings(19)
.FaceId = 2605
.Style = msoButtonIconAndCaption
.Tag = "Weiterleiten"
.OnAction = CITRIX & "1.Mailprogramm.Mail3"
.Visible = True
End With
End If
Set myControl = oBar.FindControl(, , "Betreff anpassen")
If myControl Is Nothing Then
Set myControl = oBar.Controls.Add(, , , 5, True)
With myControl
.Caption = settings(21)
.FaceId = 2310
.Style = msoButtonIconAndCaption
.Tag = "Betreff anpassen"
.OnAction = CITRIX & "1.Mailprogramm.Betreff_anpassen"
.Visible = True
End With
End If
Set myControl = oBar.FindControl(, , "Datum einfügen")
If myControl Is Nothing Then
Set myControl = oBar.Controls.Add(, , , 6, True)
With myControl
.Caption = "Datum einfügen"
.FaceId = 2143
.Style = msoButtonIconAndCaption
.Tag = "Datum einfügen"
.OnAction = CITRIX & "1.Mailprogramm.Datum_insert"
.Visible = True
End With
End If
End Sub
Sub Leiste_loeschen()
Dim oExp As Outlook.Explorer
Dim oBar As Office.CommandBar
Dim myControl As CommandBarButton
Set oExp = Outlook.ActiveExplorer
Set oBar = oExp.CommandBars.Item("Standard")
Set myControl = oBar.FindControl(, , "Neue Mail")
If Not myControl Is Nothing Then myControl.Delete
Set myControl = oBar.FindControl(, , "Allen antworten")
If Not myControl Is Nothing Then myControl.Delete
Set myControl = oBar.FindControl(, , "Weiterleiten")
If Not myControl Is Nothing Then myControl.Delete
Set myControl = oBar.FindControl(, , "Betreff anpassen")
If Not myControl Is Nothing Then myControl.Delete
Set myControl = oBar.FindControl(, , "Datum einfügen")
If Not myControl Is Nothing Then myControl.Delete
End Sub
Er bleibt beim ersten "Set myControl = oBar.Controls.Add(, , , 2, True)" hängen. Könnt Ihr mir Tipps geben wie ich das Problem lösen kann?