简体   繁体   English

Outlook 2007外接程序部署为DLL

[英]Outlook 2007 Add-in Deployment as a DLL

I had my first outlook add-in developed, 我开发了第一个Outlook外接程序,

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 ). 我可以看到调试外接程序会自动打开Outlook,我注意到在连接外接程序( 作为一个带有一个按钮的新菜单 )时,Outlook大约需要20秒才能打开。
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 OutlookOutlookAddIn2.vsto文件用作我的自定义加载项,但是当我看到其他加载项时,它们都是dll而非vsto的dll,它们在启动时不会挂断Outlook

What should I do to deploy my project as dll and yet not to freeze my outlook on startup? 我应该怎么做才能将项目部署为dll,又不冻结启动时的前景?

Thank you in advance. 先感谢您。

ps: eventually the add-in will be implemented in our intranet employees outlook accounts ps:最终,该加载项将在我们的Intranet员工Outlook帐户中实现

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
}

} }

Probably you run into the "Check for publishers certificate revocation" bottleneck. 可能您遇到了“检查发布者证书吊销”瓶颈。 It has nothing to do with Outlook, but with .net-assemblies running in an environment without proper internet access. 它与Outlook无关,但与在没有适当Internet访问的环境中运行的.net程序集无关。 See this entry in the Add-in Express forum, with a reference to this discussion . 请参阅Add-in Express论坛中的此条目 ,并参考此讨论 Either you can disable an IE setting, or try to verify the Internet access. 您可以禁用IE设置,也可以尝试验证Internet访问。

I are always running myself into this problem when my VMWare development machine thinks it has network access, but the host's network is switched off, eg the VM is bridged to the host, but the network cable of the host is not plugged in, or if the VMWare guest is part of a domain with a domain controller running (=> network available), but this network has no Internet access and no proper Certificate Authority. 当我的VMWare开发机器认为它具有网络访问权限,但主机的网络已关闭,例如VM已桥接到主机,但主机的网络电缆未插入时,或者VMWare guest虚拟机是运行域控制器(=>网络可用)的域的一部分,但是该网络无法访问Internet,也没有适当的证书颁发机构。 In this case, slow startup time. 在这种情况下,启动时间会很慢。 If the host has Internet access, no startup delay. 如果主机可以访问Internet,则没有启动延迟。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM