如何以编程方式判断安装了哪些 Outlook 插件以及它们是否已启用?

发布于 2024-12-02 21:28:03 字数 75 浏览 0 评论 0原文

如何确定安装了哪些 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

清秋悲枫 2024-12-09 21:28:03

(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.

星軌x 2024-12-09 21:28:03

要确定哪些已安装的加载项处于活动状态(已启用/已加载):

'Loop through all installed add-ins and show whether they are active or not.
Dim app As New Outlook.Application
Dim name As String
Dim loaded As Boolean
For i = 1 To app.COMAddIns.Count
    name = app.COMAddIns.Item(i).Description
    loaded = app.COMAddIns.Item(i).Connect 'Returns True for active, False for inactive
    MsgBox(name & ": " & loaded)
Next

要按名称检查特定加载项的状态:

Dim app As New Outlook.Application
Dim addinName As String = "ADD-IN NAME"
Dim loaded As Boolean = app.COMAddIns.Item(addinName).Connect
MsgBox(addinName & ": " & loaded)

To determine which installed add-ins are active (enabled/loaded):

'Loop through all installed add-ins and show whether they are active or not.
Dim app As New Outlook.Application
Dim name As String
Dim loaded As Boolean
For i = 1 To app.COMAddIns.Count
    name = app.COMAddIns.Item(i).Description
    loaded = app.COMAddIns.Item(i).Connect 'Returns True for active, False for inactive
    MsgBox(name & ": " & loaded)
Next

To check the status of a specific add-in by name:

Dim app As New Outlook.Application
Dim addinName As String = "ADD-IN NAME"
Dim loaded As Boolean = app.COMAddIns.Item(addinName).Connect
MsgBox(addinName & ": " & loaded)
七堇年 2024-12-09 21:28:03

您甚至可以从 Outlook 外部访问该信息。

    Dim count As Integer
    Dim app As New Outlook.Application

    count = app.COMAddIns.Count

    For i = 1 To count

        MsgBox(app.COMAddIns.Item(0).Description)

    Next

You can access that information even from outside of outlook.

    Dim count As Integer
    Dim app As New Outlook.Application

    count = app.COMAddIns.Count

    For i = 1 To count

        MsgBox(app.COMAddIns.Item(0).Description)

    Next
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文