I had my first outlook add-in developed,
I can see that debugging the add-in opens the outlook automatically, the issue i noticed that outlook takes about 20 sec to open when my add-in attached (as new menu with one button).
I thought it might be caused by the fact the im debugging my project!,
I published my add-in to my localhost, and then installed it using the click once thing, but still hangs on load
the outlookAddIn2.vsto file is used by outlook as my custom add-in, but when i saw the other add-ins all of them was dlls not vsto plus they dont hang up the outlook on start
What should I do to deploy my project as dll and yet not to freeze my outlook on startup?
Thank you in advance.
p.s.: eventually the add-in will be implemented in our intranet employees outlook accounts
EDIT:
namespace OutlookAddIn2
{
public partial class ThisAddIn
{
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
MyToolBar();
}
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
}
Office.CommandBar mainMenuBar;
Office.CommandBarPopup oldMenuBar;
Office.CommandBarPopup myMenuBar;
Office.CommandBarButton myButton;
private void MyToolBar()
{
try
{
mainMenuBar = this.Application.ActiveExplorer().CommandBars.ActiveMenuBar;
oldMenuBar = (Office.CommandBarPopup)this.Application.ActiveExplorer().CommandBars.ActiveMenuBar.FindControl
(
Office.MsoControlType.msoControlPopup, missing, "Katakit", true,true
);
if (oldMenuBar != null)
oldMenuBar.Delete(true);
myMenuBar = (Office.CommandBarPopup)mainMenuBar.Controls.Add(
Office.MsoControlType.msoControlPopup,
missing, missing, missing, false);
if (myMenuBar != null)
{
// Add a button to the new toolbar.
myMenuBar.Caption = "Katakit";
myMenuBar.Visible = true;
myMenuBar.Tag = "Katakit";
myButton = (Office.CommandBarButton)myMenuBar.Controls.Add
(Office.MsoControlType.msoControlButton, missing, missing, missing, true);
myButton.Caption = "Pending Summary 2";
myButton.FaceId = 500;
myButton.Tag = "btnPendingSummary";
myButton.Visible = true;
}
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show("Error: " + ex.Message.ToString()
, "Error Message");
}
}
#region VSTO generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InternalStartup()
{
this.Startup += new System.EventHandler(ThisAddIn_Startup);
this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
}
#endregion
}
}