K
kshihabi
Hello,
I have created an addin that just adds a button to Micrososft outlook.
The add-in adds a button to the toolbar.... When I run my add-in I can
see the button being added. However, When I click on build > install
build and run the setup file. I do get nothing added on the toolbar. :
( Is there anything that I should do to get my button being
permanently added to the toolbar, Am I missing something in the setup?
Here is my code:
Imports Office = Microsoft.Office.Core
'Imports Extensibility
Imports System.Runtime.InteropServices
Imports Microsoft.Office.Core.MsoAlertButtonType
Imports Microsoft.Office.Core.MsoFileDialogType
Imports Microsoft.Office.Core.MsoFileDialogView
Imports outlook = Microsoft.Office.Interop.Outlook
public class ThisAddIn
Private _cbBar As Office.CommandBar
'Dim docsave As clsDoc.clsform
'dim savefile2 as cls
Private WithEvents _cbButton As Office.CommandBarButton
Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Startup
Dim explorer As outlook.Explorer =
Me.Application.ActiveExplorer
' Create a new (temporary) CommandBar object.
_cbBar = explorer.CommandBars.Add("SO.dms1",
Office.MsoBarPosition.msoBarTop, False, True)
' Create a CommandBarButton object.
_cbButton =
CType(_cbBar.Controls.Add(Office.MsoControlType.msoControlButton),
Office.CommandBarButton)
_cbButton.Caption = "SO.dms1"
_cbButton.Style =
Microsoft.Office.Core.MsoButtonStyle.msoButtonCaption
' Make the new CommandBar visible.
_cbBar.Visible = True
explorer = Nothing
End Sub
Private Sub ThisAddIn_Shutdown(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Shutdown
_cbButton.Delete()
_cbButton = Nothing
End Sub
End class
I have created an addin that just adds a button to Micrososft outlook.
The add-in adds a button to the toolbar.... When I run my add-in I can
see the button being added. However, When I click on build > install
build and run the setup file. I do get nothing added on the toolbar. :
( Is there anything that I should do to get my button being
permanently added to the toolbar, Am I missing something in the setup?
Here is my code:
Imports Office = Microsoft.Office.Core
'Imports Extensibility
Imports System.Runtime.InteropServices
Imports Microsoft.Office.Core.MsoAlertButtonType
Imports Microsoft.Office.Core.MsoFileDialogType
Imports Microsoft.Office.Core.MsoFileDialogView
Imports outlook = Microsoft.Office.Interop.Outlook
public class ThisAddIn
Private _cbBar As Office.CommandBar
'Dim docsave As clsDoc.clsform
'dim savefile2 as cls
Private WithEvents _cbButton As Office.CommandBarButton
Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Startup
Dim explorer As outlook.Explorer =
Me.Application.ActiveExplorer
' Create a new (temporary) CommandBar object.
_cbBar = explorer.CommandBars.Add("SO.dms1",
Office.MsoBarPosition.msoBarTop, False, True)
' Create a CommandBarButton object.
_cbButton =
CType(_cbBar.Controls.Add(Office.MsoControlType.msoControlButton),
Office.CommandBarButton)
_cbButton.Caption = "SO.dms1"
_cbButton.Style =
Microsoft.Office.Core.MsoButtonStyle.msoButtonCaption
' Make the new CommandBar visible.
_cbBar.Visible = True
explorer = Nothing
End Sub
Private Sub ThisAddIn_Shutdown(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Shutdown
_cbButton.Delete()
_cbButton = Nothing
End Sub
End class