Building Office Add-ins
Please review Office Add-ins platform overview before reading this article.
Office Add-ins extend the UI and functionality of Office applications and interact with content in Office documents. You'll use familiar web technologies to create Office Add-ins that extend and interact with Word, Excel, PowerPoint, OneNote, Project, or Outlook. The add-ins you build can run in Office across multiple platforms, including Windows, Mac, iPad, and in a browser. This article provides an introduction to developing Office Add-ins.
Creating an Office Add-in
You can create an Office Add-in by using the Yeoman generator for Office Add-ins or Visual Studio.
Yeoman generator for Office Add-ins
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.
Exploring APIs with Script Lab
The following one-minute video shows Script Lab in action.
Extending 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, see Office UI elements for Office Add-ins.
Core development concepts
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.
Defining 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, custom tabs, 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.
Interacting with content in an Office document
<script> tag in the
<head> tag of the page.
Excel Custom functions run within a unique runtime that prioritizes execution of calculations, and therefore uses a slightly different programming model. For details, see Custom functions architecture.
API requirement sets
Requirement sets are named groups of API members. Requirement sets can be specific to Office hosts, such as the
ExcelApi 1.7 requirement set (a set of APIs that can only be used in Excel), or common to multiple hosts, 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 host supports the API members that it needs to use. For more information about this, see Specify Office hosts and API requirements.
Requirement set support varies by Office host, version, and platform. For detailed information about the platforms, requirement sets, and Common APIs that each Office application supports, see Office Add-in host and platform availability.
Testing and debugging an Office Add-in
As you develop your add-in, you can test it locally by using a technique known as sideloading. The procedure for sideloading an add-in varies by platform, and in some cases, by product as well. Likewise, the procedure for debugging an add-in can also vary by platform and product. For more information about testing and debugging, see Test and debug Office Add-ins.
Publishing an Office Add-in
When you're ready to share your add-in with others, you'll do so by using the deployment method that best meets your objectives. For example, to deploy an add-in to users within your organization, you might use centralized deployment or publish the add-in to a SharePoint app catalog. If you want to share your add-in publicly for anyone to obtain, you can publish the add-in to AppSource. For more information about publishing, see Deploy and publish 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.
Explore the APIs with Script Lab
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 Core concepts section of this documentation, along with information in the host-specific section that corresponds to the type of add-in you're building (for example, Excel).