Why doesn't my addin get installed?

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
 
K

Ken Slovak - [MVP - Outlook]

Is this a shared addin or a VSTO addin? Did you look at the deployment
walkthroughs for VSTO and setting security if it's a VSTO addin?

When you deploy are you making sure all prerequisites are installed on the
target machine as well as the required PIA's and Framework?
 
K

kshihabi

It had to do with setting security. This article on codeproject has
helped me a lot. http://www.codeproject.com/office/Outlook_Add-in_Issues.asp



Thanks Ken



Bye


Is this a shared addin or a VSTO addin? Did you look at the deployment
walkthroughs for VSTO and setting security if it's a VSTO addin?

When you deploy are you making sure all prerequisites are installed on the
target machine as well as the required PIA's and Framework?

--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Optionshttp://www.slovaktech.com/products.htm




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
Private Sub ThisAddIn_Shutdown(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Shutdown
_cbButton.Delete()
_cbButton = Nothing
End Sub
End class- Hide quoted text -

- Show quoted text -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top