Outlook 加载项概述Outlook add-ins overview

Outlook 加载项由第三方使用基于 Web 的平台集成到 Outlook 中。Outlook add-ins are integrations built by third parties into Outlook by using our web-based platform. Outlook 加载项有三个主要方面:Outlook add-ins have three key aspects:

  • 相同的加载项和业务逻辑可跨桌面(Windows 版 Outlook 和 Outlook for Mac)、Web(Office 365 和 Outlook.com)和移动平台使用。The same add-in and business logic works across desktop (Outlook for Windows and Mac), web (Office 365 and Outlook.com), and mobile.
  • Outlook 外接程序包括一个清单,其中介绍了如何将外接程序集成到 Outlook(例如,按钮或任务窗格)中,以及构成外接程序 UI 和业务逻辑的 JavaScript/HTML 代码。Outlook add-ins consist of a manifest, which describes how the add-in integrates into Outlook (for example, a button or a task pane), and JavaScript/HTML code, which makes up the UI and business logic of the add-in.
  • 最终用户或管理员可以从 AppSource 获取 Outlook 加载项,也可以进行旁加载Outlook add-ins can be acquired from the Office store or side-loaded by end-users or administrators.

Outlook 加载项不同于 COM 或 VSTO 的加载项,后者为特定于 Windows 版 Outlook的较旧集成。Outlook add-ins are different from COM or VSTO add-ins, which are older integrations specific to Outlook running on Windows. Outlook 加载项与 COM 加载项不同,它在用户的设备或 Outlook 客户端上没有通过物理方式安装任何代码。Unlike COM add-ins, Outlook add-ins don't have any code physically installed on the user's device or Outlook client. 对于 Outlook 加载项,Outlook 读取清单,挂钩 UI 中的指定控件,然后加载 JavaScript 和 HTML。For an Outlook add-in, Outlook reads the manifest and hooks up the specified controls in the UI, and then loads the JavaScript and HTML. Web 组件都在沙盒浏览器的上下文中运行。The web components all run in the context of a browser in a sandbox.

支持加载项的 Outlook 项目包括电子邮件、会议请求、响应和取消及约会。The Outlook items that support add-ins include email messages, meeting requests, responses and cancellations, and appointments. 每个 Outlook 加载项均定义其可用的上下文,包括项目类型以及用户是在阅读还是撰写项目。Each Outlook add-in defines the context in which it is available, including the types of items and if the user is reading or composing an item.


生成加载项时,如果计划将加载项发布到 AppSource,请务必遵循 AppSource 验证策略。例如,加载项必须适用于支持已定义方法的所有平台,才能通过验证(有关详细信息,请参阅第 4.12 部分以及 Office 加载项主机和可用性页面)。When you build your add-in, if you plan to publish your add-in to AppSource, make sure that you conform to the AppSource validation policies. For example, to pass validation, your add-in must work across all platforms that support the methods that you define (for more information, see section 4.12 and the Office Add-in host and availability page).

扩展点Extension points

扩展点是加载项与 Outlook 集成的方式。以下是执行此操作的方法:Extension points are the ways that add-ins integrate with Outlook. The following are the ways this can be done:

  • 加载项可以声明出现在所有邮件和约会的命令界面中的按钮。有关详细信息,请参阅 用于 Outlook 的加载项命令Add-ins can declare buttons that appear in command surfaces across messages and appointments. For more information, see Add-in commands for Outlook.

    功能区上具有命令按钮的加载项An add-in with command buttons on the ribbon

    加载项命令无 UI 形状

  • 加载项可以在邮件和约会中中断与正则表达式匹配项或检测实体的链接。 有关详细信息,请参阅 上下文 Outlook 加载项Add-ins can link off regular expression matches or detected entities in messages and appointments. For more information, see Contextual Outlook add-ins.

    用于突出显示的实体(地址)的上下文相关加载项A contextual add-in for a highlighted entity (an address)



已弃用自定义窗格,因此,请确保使用的是受支持的扩展点。Custom panes have been deprecated so please ensure that you're using a supported extension point.

外接程序可用的邮箱项目Mailbox items available to add-ins

在撰写或阅读时,Outlook 外接程序对邮件或约会可用,但对其他项目类型不可用。如果撰写或阅读窗体中的当前邮件项目为以下项之一,则 Outlook 不会激活邮件外接程序:Outlook add-ins are available on messages or appointments while composing or reading, but not other item types. Outlook does not activate add-ins if the current message item, in a compose or read form, is one of the following:

  • 使用信息权限管理 (IRM) 进行保护,或使用其他保护方式进行加密。数字签名邮件便是其中一个例子,因为数字签名依赖于这些机制之一。Protected by Information Rights Management (IRM) or encrypted in other ways for protection. A digitally signed message is an example since digital signing relies on one of these mechanisms.

  • 具有邮件类别 IPM.Report.* 的送达报告或通知,包括送达和未送达报告 (NDR),以及已读、未读和延迟通知。A delivery report or notification that has the message class IPM.Report.*, including delivery and Non-Delivery Report (NDR) reports, and read, non-read, and delay notifications.

  • 草稿(没有为其分配发件人),或位于 Outlook 草稿文件夹中。A draft (does not have a sender assigned to it), or in the Outlook Drafts folder.

  • 属于其他邮件的附件的 .msg 或 .eml 文件。A .msg or .eml file which is an attachment to another message.

  • 从文件系统打开的 .msg 或 .eml 文件。A .msg or .eml file opened from the file system.

  • 在共享邮箱、其他用户的邮箱、存档邮箱或公用文件夹中。In a shared mailbox, in another user's mailbox, in an archive mailbox, or in a public folder.

  • 使用自定义窗体。Using a custom form.

通常,Outlook 可以为"已发送邮件"文件夹中的项目在阅读窗体中激活加载项,基于已知实体字符串匹配激活的加载项除外。In general, Outlook can activate add-ins in read form for items in the Sent Items folder, with the exception of add-ins that activate based on string matches of well-known entities. 欲了解其背后原因的详细信息,请参阅将 Outlook 项中的字符串作为已知实体进行匹配For more information about the reasons behind this, see "Support for well-known entities" in Match strings in an Outlook item as well-known entities.

支持的主机Supported hosts

Windows 版 Outlook 2013 或更高版本、Mac 版 Outlook 2016 或更高版本、Outlook 网页版(本地 Exchange 2013 和更高版本)、iOS 版 Outlook、Android 版 Outlook 及 Outlook 网页版(Office 365 和 Outlook.com)支持 Outlook 加载项。Outlook add-ins are supported in Outlook 2013 or later for Windows, Outlook 2016 or later for Mac, Outlook Web App for Exchange 2013 on-premises and later versions, Outlook for iOS, Outlook for Android, and Outlook on the web in Office 365 and Outlook.com. 并非所有客户端都同时支持全部最新功能。Not all of the newest features are supported in all clients at the same time. 有关这些功能的信息,请参阅文章和 API 参考,了解它们可能在哪些主机中受支持或不受支持。Please refer to articles and API references for those features to see which hosts they may or may not be supported in.

开始构建 Outlook 外接程序Get started building Outlook add-ins

若要开始生成 Outlook 加载项,请尝试执行以下操作。To get started building Outlook add-ins, try the following.

  • 快速入门 - 生成简单的任务窗格。Quick start - Build a simple task pane.
  • 教程 - 了解如何创建将 GitHub Gist 插入新邮件的加载项。Tutorial - Learn how to create an add-in that inserts GitHub gists into a new message.

另请参阅See also