Outlook 2007加载项部署作为DLL [英] Outlook 2007 Add-in Deployment as a DLL

查看:223
本文介绍了Outlook 2007加载项部署作为DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了我的第一个外观加载项,



我可以看到调试加载项会自动打开外观,问题我注意到outlook需要 20秒打开,当我的加载项附加(作为新的菜单与一个按钮)。

我以为可能是由于事实造成的我调试我的项目!

我发布我的加载项到我的本地主机,然后使用点击一次的东西安装,但仍挂载加载

outlookAddIn2 .vsto 文件被outlook用作我的自定义加载项,但是当我看到其他加载项,所有这些都是dll不是vsto加上他们没有挂起开始的前景



我应该如何将我的项目部署为dll,但不能冻结我的启动前景?



提前谢谢。 p>

ps:最终的加载项将在我们的内部网络员工外展帐户中实现



编辑:

 命名空间Outlook AddIn2 
{
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,缺少Katakit,true ,真
);
if(oldMenuBar!= null)
oldMenuBar.Delete(true);
myMenuBar =(Office.CommandBarPopup)mainMenuBar.Controls.Add(
Office.MsoControlType.msoControlPopup,
missing,missing,missing,false);


if(myMenuBar!= null)
{
//向新工具栏添加一个按钮。
myMenuBar.Caption =Katakit;
myMenuBar.Visible = true;
myMenuBar.Tag =Katakit;
myButton =(Office.CommandBarButton)myMenuBar.Controls.Add
(Office.MsoControlType.msoControlButton,missing,missing,missing,true);
myButton.Caption =待处理摘要2;
myButton.FaceId = 500;
myButton.Tag =btnPendingSummary;
myButton.Visible = true;


}
}
catch(System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(Error :+ ex.Message.ToString()
,错误消息);
}
}

#region VSTO生成代码

///< summary>
/// Designer支持的必需方法 - 不要使用代码编辑器修改
///该方法的内容。
///< / summary>
private void InternalStartup()
{
this.Startup + = new System.EventHandler(ThisAddIn_Startup);
this.Shutdown + = new System.EventHandler(ThisAddIn_Shutdown);
}

#endregion
}

}

解决方案

可能您遇到了检查发布商证书撤销的瓶颈。它与Outlook无关,但是.net程序集在没有适当Internet访问的环境中运行。请参阅此条目在Add-in Express论坛中,引用这个讨论。您可以禁用IE设置,或尝试验证Internet访问。



当我的VMWare开发机器认为它具有网络访问权限时,我总是遇到这个问题,但主机的网络已关闭,例如虚拟机被桥接到主机,但主机的网络电缆未插入,或者如果VMWare来宾是运行域控制器(=>网络可用)的域的一部分,但该网络没有Internet访问,没有适当的证书颁发机构。在这种情况下,启动时间较慢。如果主机有Internet访问,则不启动延迟。


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
}

}

解决方案

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. See this entry in the Add-in Express forum, with a reference to this discussion. Either you can disable an IE setting, or try to verify the Internet access.

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, e.g. 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. In this case, slow startup time. If the host has Internet access, no startup delay.

这篇关于Outlook 2007加载项部署作为DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆