【发布时间】:2016-10-30 23:55:24
【问题描述】:
我已经看到大量解决此问题的帖子和网站。我已经尝试了我找到的所有解决方案,但它们都不起作用(我已经试图解决这个问题好几天了)。我看过很多帖子都有相同的听起来问题,但要么解决方案对我不起作用,要么不适用。话虽如此...
我有一个 Outlook 2007 加载项,旨在将文本添加到电子邮件的标题和正文。它是为所有使用 .msi 文件的用户安装的。我去年部署的一个旧版本运行良好。我创建的新版本只有一些小的输入/输出更改,没什么大不了的。这个新版本在我的开发计算机上完美运行,无论是从 Visual Studio 调试还是从实际安装。但是,我无法让它在非开发计算机上工作。以下是程序和目标计算机的详细信息(开发计算机和目标计算机的详细信息相同,只是目标计算机没有Visual Studio):
-Using Visual Studio Professional 2013
-Written in Visual Basic
-Target Framework is .NET 4.0
-The add-in is only run once the "send" button on an email is clicked.
-Outlook version is Outlook 2007
-Operating system is Windows 7 Enterprise SP1 32-bit
问题是加载项无法在目标计算机上加载(是的,我知道,无数其他人也遇到过同样的问题)。正如我之前所说,它在我的计算机上无论是调试版本还是安装版本都可以正常工作。这让我觉得另一台计算机缺少某些东西,所以我尝试将 .NET 4.0 框架安装到目标计算机上,但它告诉我它已经安装了。我跑了所有我能想到的让它工作但无济于事。以下是它的行为方式:
-Installs fine with no errors.
-HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Office/Outlook/Addins/EmailMarkTool/LoadBehavior = 3 after installation.
-VSTO_LOGALERTS = 1
-VSTO_SUPPRESSDISPLAYALERTS = 0
-Outlook opens with no apparent errors.
-LoadBehavior = 0 immediately after Outlook is opened.
-Shows up in the Add-ins under "Inactive Application Add-ins."
-Never shows up under "Disabled Add-ins."
-In the "COM Add-Ins" dialog where I can check which add-ins to use, it shows the correct directory and the Load Behavior is "Unloaded."
-The add-in can be checked. When I click "OK" I don't get any errors. When I go back to the Add-ins, it is unchecked and "Unloaded" again.
-Setting the LoadBehavior to 3 doesn't help because it goes back to 0 as soon as Outlook is started again.
-I inserted a try-catch block into the New() function of the add-in that has a MsgBox pop-up and a Throw.
-I get absolutely no errors anywhere.
-No log file is generated.
我已尝试多次卸载、重建和重新安装,结果都相同。我只是不知道为什么它可以在我的开发计算机上运行,但不能在目标计算机上运行。感谢您阅读所有这些内容。我知道这很多,但我需要了解详细信息。提前感谢您的任何意见!
[更新]:我刚刚创建了一个全新的最小加载项,只是为了测试它是否可以工作,但得到了相同的结果。
【问题讨论】:
-
不确定你是否看过这个stackoverflow.com/questions/4668777/…,但它可能会有所帮助。
-
@JimHewitt 是的,我读了好几遍。我的加载项从未出现在禁用的加载项中。
-
我猜你也看到了这个outlook-apps.com/inactive-outlook-add-ins,但为了以防万一,有一节是关于“启用持续卸载的非活动 Outlook 加载项:。
-
@JimHewitt 是的,如描述中所述,我尝试了很多次。
-
由于我即将部署 Excel VSTO 加载项,因此我对您的问题很感兴趣。一个想法,这可能是特定于 Outlook 安全性的吗?找到这个msdn.microsoft.com/en-us/library/1thd35d7.aspx。另外,您创建的最小加载项也是 Outlook 吗?想知道是否值得尝试部署一个最小的 Excel 加载项,看看它是否有效。
标签: vb.net outlook vsto outlook-addin outlook-2007