我有我的第一个Outlook插件开发,2007外接部署为DLL
我可以看到,调试外接自动打开的前景,这个问题我注意到,前景约需20秒打开时,我的加载项附加(作为新菜单与一个按钮)。
我想这可能由事实IM引起调试我的项目!
我发表我的加载到我的本地主机,然后使用点击一次的事情安装了它,但仍挂在负载
的outlookAddIn2 .vsto文件被outlook用作我的自定义加载项,但是当我看到其他加载项时,他们全都是dll而不是vsto加上他们不会挂断启动前景
我应该如何部署我的项目为DLL,但不冻结我的启动前景?
预先感谢您。
PS:最终的加载项将在我们的内部网的员工面貌实现占
编辑:
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
}
}
你的插件是否在启动时执行一些重负载? – HABJAN 2011-03-30 13:20:49
没有,只是新的菜单和一个按钮 – 2011-03-30 13:22:39
20秒加载只发生在第一次或每次? – HABJAN 2011-03-30 13:25:24