R
René Meinecke
Hi there,
still the same problem but now with other code. I´m using VB.NET now and the
code is:
Dim WithEvents btnAntrago As Office.CommandBarButton
Private WithEvents expclOutlook As Outlook.ExplorerClass
Public Sub OnStartupComplete(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnStartupComplete
Dim cbarsOffice As Office.CommandBars
Dim cbarOffice As Office.CommandBar
expclOutlook = appOutlook.ActiveExplorer()
On Error Resume Next
cbarsOffice = appOutlook.CommandBars
If cbarsOffice Is Nothing Then
cbarsOffice = expclOutlook.CommandBars()
End If
cbarOffice = cbarsOffice.Item("Standard")
btnAntrago = cbarOffice.Controls.Item(strTitle)
If btnAntrago Is Nothing Then
btnAntrago = cbarOffice.Controls.Add(1)
With btnAntrago
..Caption = strTitle
..Style = Office.MsoButtonStyle.msoButtonCaption
..Tag = strTitle
..OnAction = "!<ANTRAGO_EMail_AddIn.Connect>"
End With
End If
End Sub
Private Sub expOutlook_Close() Handles
expclOutlook.ExplorerEvents_Event_Close
btnAntrago.Delete()
btnAntrago = Nothing
expclOutlook = Nothing
End Sub
peace René
still the same problem but now with other code. I´m using VB.NET now and the
code is:
Dim WithEvents btnAntrago As Office.CommandBarButton
Private WithEvents expclOutlook As Outlook.ExplorerClass
Public Sub OnStartupComplete(ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnStartupComplete
Dim cbarsOffice As Office.CommandBars
Dim cbarOffice As Office.CommandBar
expclOutlook = appOutlook.ActiveExplorer()
On Error Resume Next
cbarsOffice = appOutlook.CommandBars
If cbarsOffice Is Nothing Then
cbarsOffice = expclOutlook.CommandBars()
End If
cbarOffice = cbarsOffice.Item("Standard")
btnAntrago = cbarOffice.Controls.Item(strTitle)
If btnAntrago Is Nothing Then
btnAntrago = cbarOffice.Controls.Add(1)
With btnAntrago
..Caption = strTitle
..Style = Office.MsoButtonStyle.msoButtonCaption
..Tag = strTitle
..OnAction = "!<ANTRAGO_EMail_AddIn.Connect>"
End With
End If
End Sub
Private Sub expOutlook_Close() Handles
expclOutlook.ExplorerEvents_Event_Close
btnAntrago.Delete()
btnAntrago = Nothing
expclOutlook = Nothing
End Sub
peace René