Develop Office Add-ins
Please review Office Add-ins platform overview before reading this article.
Create an Office Add-in
You can create an Office Add-in by using the Yeoman generator for Office Add-ins or Visual Studio.
The Yeoman generator for Office Add-ins can be used to create a Node.js Office Add-in project that can be managed with Visual Studio Code or any other editor. The generator can create Office Add-ins for any of the following:
- Excel custom functions
Although it's possible to create Office Add-ins using Visual Studio, using the Yeoman generator provides a better developer experience in some notable ways.
The Yeoman generator provides a wider range of options for project types, frameworks, and languages than Visual Studio does for Office Add-in projects.
Project templates in the Yeoman generator are updated more frequently than project templates in Visual Studio.
Understand the two parts of an Office Add-in
An Office Add-in consists of two parts.
The add-in manifest (an XML file) that defines the settings and capabilities of the add-in.
The web application that defines the UI and functionality of add-in components such as task panes, content add-ins, and dialog boxes.
Define an add-in's settings and capabilities
An Office Add-in's manifest (an XML file) defines the settings and capabilities of the add-in. You'll configure the manifest to specify things such as:
- Metadata that describes the add-in (for example, ID, version, description, display name, default locale).
- Office applications where the add-in will run.
- Permissions that the add-in requires.
- How the add-in integrates with Office, including any custom UI that the add-in creates (for example, a custom tab or custom ribbon buttons).
- Location of images that the add-in uses for branding and command iconography.
- Dimensions of the add-in (for example, dimensions for content add-ins, requested height for Outlook add-ins).
- Rules that specify when the add-in activates in the context of a message or appointment (for Outlook add-ins only).
For detailed information about the manifest, see Office Add-ins XML manifest.
Interact with content in an Office document
<script> tag in the
<head> tag of the page.
This API model uses promises and allows you to specify multiple operations in each request you send to the Office application. Batching operations in this manner can significantly improve add-in performance in Office applications on the web. Application-specific APIs were introduced with Office 2016 and cannot be used to interact with Office 2013.
There is also an application-specific API for Visio, but you can use it only in SharePoint Online pages to interact with Visio diagrams that have been embedded in the page. Office web add-ins are not supported in Visio.
See Using the application-specific API model to learn more about this API model.
API requirement sets
Requirement sets are named groups of API members. Requirement sets can be specific to Office applications, such as the
ExcelApi 1.7 requirement set (a set of APIs that can only be used in Excel), or common to multiple applications, such as the
DialogApi 1.1 requirement set (a set of APIs that can be used in any Office application that supports the Dialog API).
Your add-in can use requirement sets to determine whether the Office application supports the API members that it needs to use. For more information about this, see Specify Office applications and API requirements.
Requirement set support varies by Office application, version, and platform. For detailed information about the platforms, requirement sets, and Common APIs that each Office application supports, see Office client application and platform availability for Office Add-ins.
Explore APIs with Script Lab
The following one-minute video shows Script Lab in action.
Extend the Office UI
An Office Add-in can extend the Office UI by using add-in commands and HTML containers such as task panes, content add-ins, or dialog boxes.
The following image shows an add-in command in the ribbon, a task pane to the right of the document, and a dialog box or content add-in over the document.
For more information about extending the Office UI and designing the add-in's UX, see Office UI elements for Office Add-ins.
Create an Office Add-in
You can quickly create a basic add-in for Excel, OneNote, Outlook, PowerPoint, Project, or Word by completing a 5-minute quick start. If you've previously completed a quick start and want to create a slightly more complex add-in, you should try the tutorial.
Learn more about developing, testing, and publishing Office Add-ins by exploring this documentation.
For any add-in that you build, you'll use information in the Development lifecycle section of this documentation, along with information in the application-specific section that corresponds to the type of add-in you're building (for example, Excel).