如何以编程方式判断安装了哪些 Outlook 插件以及它们是否已启用?
如何确定安装了哪些 Outlook COM 或 PIA 插件以及它们是否已启用。
我怎样才能获得这些信息,以及文件版本?
How do I determine what Outlook COM or PIA addins are installed, and if they are enabled or not.
How can I get this information, and hopefully the file version as well?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
(1) 如果您想从另一个 Outlook 加载项内部访问此信息,您可以使用 Application.ComAddins 对象(例如,它的 Count 属性为您提供安装的加载项的数量)。您可以循环访问此集合,并检查单个 COMAddin 对象的 LoadBehaviour 属性是否正在加载或是否已禁用。
(2) 如果您想从 Outlook 外部访问信息,您可以考虑阅读 Software\Microsoft\Office\Outlook\Addins 项下的相应注册表项。
(3) 请注意,您根本不能信任此信息,因为 Office 加载项既可以为单个用户安装,也可以为所有用户安装。因此,您绝对无法访问已安装的加载项,只能通过读取 HKLM 下的上述键 (a) 和 HKCU 下的 (b) 来访问运行您的应用程序/程序的当前用户。 Application.COMAddins 对象向您显示混合在一起的两种信息。
(4) 我不记得 COMAddin 对象或注册表中是否有可用的版本号。要访问它,您必须读取注册表以查找加载项的文件或程序集,并访问文件版本。请注意,用 Visual Basic 6 或其他语言编写的“旧”COM 外接程序具有除 VSTO 外接程序或基于外接程序 Express 工具的外接程序之外的其他注册表项。
(1) If you want to access this information from inside another Outlook Add-in, you may use the the Application.ComAddins object (e.g. it's Count property gives you the number of add-ins installed). You can loop through this collection and check the LoadBehaviour property of the single COMAddin object to now if they're loading or if they're disabled.
(2) If you wand to access the information from outside of Outlook, you may consider to read the appropriate registry entries under the Software\Microsoft\Office\Outlook\Addins key.
(3) Please be aware that you cannot trust this information at all, because Office add-ins can be installed either for a single user or for all users. So you cannot access the installed add-ins absolutely, but only for the current user running your app /your procedure, by reading the abovementioned key (a) under HKLM and (b) under HKCU. The Application.COMAddins object shows you both information blended in one.
(4) I don't recall that a version number is available either in the COMAddin object or in the registry. To access that, you'll have to read the registry to find the file or assembly of the add-in, and access the file version. Please note that "old" COM Add-ins written in Visual Basic 6 or another language have other registry entries than VSTO add-ins or add-ins based on the Add-in Express tool.
要确定哪些已安装的加载项处于活动状态(已启用/已加载):
要按名称检查特定加载项的状态:
To determine which installed add-ins are active (enabled/loaded):
To check the status of a specific add-in by name:
您甚至可以从 Outlook 外部访问该信息。
You can access that information even from outside of outlook.