NetOffice Outlook 插件部署

NetOffice Outlook Plugin Deployment

我正在使用 NetOffice 开发 Outlook 插件。通过 Visual Studio(如果我 运行 项目然后打开 Outlook,功能就在那里)部署时(不知何故神奇地),这个插件在我的本地机器上工作。一切都很好,直到这里。但是,我需要将它部署到其他人的计算机(没有安装 VS),我真的很难找到如何做到这一点的方法。

我的插件是这样的:

[COMAddin(Constants.ProjectName, "Tool", 3)]
[Guid("B3F60319-1A11-4F3E-9C1B-3AE908D9CA86"), ProgId("Tool.OutlookIntegration")]
public class OutlookIntegration : COMAddin
{
    public OutlookIntegration()
    {
        this.OnStartupComplete += new OnStartupCompleteEventHandler(this.Integrate);

        _settings = new Settings();
    }

    /* Integrate creates a menu item which does what I need. */
}

项目类型是图书馆。现在,问题是我如何在别人的 PC 上制作这个 运行?如果您碰巧知道一些教程或类似的东西,请告诉我。 Internet 上有关于开发 Outlook 插件的资源,但它们似乎与 NetOffice 不同。 NetOffice 本身有很好的开发文档,但没有用于部署的文档(至少我还没有找到)。

我也很乐意提供所需的任何其他详细信息。

使用什么库开发 Office 加载项并不重要。所有 COM 加载项的部署过程都是相同的。请参阅 MSDN 中的 Deploying an Office Solution 部分。

为了让 Outlook 安装插件,您唯一需要做的就是在注册表中添加一些记录

string runKey = "SOFTWARE\Microsoft\Office\Outlook\Addins";
RegistryKey startupKey = Registry.CurrentUser.OpenSubKey(runKey,  true);
if (startupKey != null)
{
  runKey="SOFTWARE\Microsoft\Office\Outlook\Addins\yourAddinNameSpace.yourAddinClass";
  startupKey = Registry.CurrentUser.OpenSubKey(runKey, true);
  if (startupKey == null)
    startupKey = Registry.CurrentUser.CreateSubKey(runKey);
    startupKey.SetValue("Description", "yourAddinName", Microsoft.Win32.RegistryValueKind.String);
    startupKey.SetValue("FriendlyName", "yourAddinName", Microsoft.Win32.RegistryValueKind.String);
    startupKey.SetValue("LoadBehavior", 3, Microsoft.Win32.RegistryValueKind.DWord);
  }
}
else 
  Console.WriteLine("Outlook is not installed");