我有我的第一個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