The Office add-ins platform enables you to extend the functionality of Office applications. In this unit, you'll explore various ways you can use add-ins to extend and interact with Office applications. You'll also learn about configuring your add-in using the add-in's manifest file.

Office add-ins provide several options for how your solution can interact with an Office application. In this unit, we discuss two of those options:

• Content

Task pane add-ins allow user interaction through a panel displayed within an Office application. Through the task pane interface, you can enable the user to modify documents or emails, view data from a data source, and more. In the following image, the task pane is the panel that's displayed to the right of the document.

In newer versions of Word, Excel, and PowerPoint, you can configure the task pane to be displayed automatically when a user opens a file. The user will need to have your add-in installed first to activate this behavior.

As described previously, an add-in's manifest file defines the settings and capabilities of the add-in.

To configure an add-in as a task pane add-in for any Office application except Outlook, set the xsi:type attribute to TaskPaneApp within the OfficeApp element of the manifest file, as shown in the following example.

<OfficeApp
...
...
</OfficeApp>


To configure an add-in for Outlook, set the xsi:type attribute to MailApp within the OfficeApp element of the manifest file, as shown in the following example.

<OfficeApp
...
xsi:type="MailApp">
...
</OfficeApp>


Content add-ins can be used to insert an object into an Excel spreadsheet or PowerPoint presentation. That object can be a web-based data visualization, media, or other external content. In the following image, the content add-in is displayed near the center of the document.

#### Define the content add-in type

As described previously, an add-in's manifest file defines the settings and capabilities of the add-in. To configure an add-in as a content add-in, set the xsi:type attribute to ContentApp within the OfficeApp element of the manifest file, as shown in the following example.

<OfficeApp
...
xsi:type="ContentApp">
...
</OfficeApp>


The Office add-ins platform enables you to display a dialog for your users to:

• Confirm the user's action.
• Run a task that might be too confined in a task pane (for example, view a video).

The dialog window isn't modal, meaning that your user can continue to interact with the Office application and your add-in while the dialog window is displayed. The following image shows a dialog being displayed in an Office application.

Dialog displayed in an Office application

## Understand Office add-ins custom functions

Office add-ins enable you to create custom JavaScript or TypeScript functions that can be accessed like built-in Excel functions such as SUM().

The following image shows a custom function called SPHEREVOLUME being entered in Excel.

Custom function being entered in Excel

The following code sample shows the JavaScript code for the SPHEREVOLUME() function shown previously.

/**
* Returns the volume of a sphere.
* @customfunction
*/
return Math.pow(radius, 3) * 4 * Math.PI / 3;
}


### Where can you use custom functions?

Custom functions are available in Excel on the following platforms.

• Windows (connected to an Office 365 subscription)
• Mac (connected to an Office 365 subscription)
• Web browser

### Define the custom function add-in type

To configure an add-in to contain custom functions, the key settings in the manifest are as follows for Excel add-ins.

<OfficeApp
...
...
<Hosts>
<Host Name="Workbook"/>
</Hosts>
...
<Hosts>
<Host xsi:type="Workbook">
<AllFormFactors>
<ExtensionPoint xsi:type="CustomFunctions">
...
</ExtensionPoint>
</AllFormFactors>
</Host>
</Hosts>
...
</VersionOverrides>
</OfficeApp>


### Add-in commands in Excel, Word, PowerPoint, and OneNote

You can configure an add-in so that a user can run it by selecting:

• Office application's ribbon or command overflow menu button
• Key manifest setting: <ExtensionPoint xsi:type="PrimaryCommandSurface">.
• Key manifest setting: <ExtensionPoint xsi:type="ContextMenu">.

The following image shows three add-in commands (custom buttons) added to the Data tab of the Excel ribbon.

Add-in commands in Excel on Windows

You can configure an add-in so that a user can run it by selecting a button in the Office ribbon or command overflow menu when the user is:

• Reading a message in the reading pane or in a pop-out window.
• Key manifest setting: <ExtensionPoint xsi:type="MessageReadCommandSurface">.
• Composing a message.
• Key manifest setting: <ExtensionPoint xsi:type="MessageComposeCommandSurface">.
• Creating or viewing an appointment or meeting as the organizer.
• Key manifest setting: <ExtensionPoint xsi:type="AppointmentOrganizerCommandSurface">.
• Viewing a meeting as an attendee.
• Key manifest setting: <ExtensionPoint xsi:type="AppointmentAttendeeCommandSurface">.

The following images show three add-in commands (custom buttons) added to the ribbon in Outlook. In the first image, the buttons are rendered in a regular state; in the second image, the buttons are rendered in a collapsed state.

Add-in commands in Outlook on Windows

### Where can you use add-in commands?

Add-in commands are available in Excel, Outlook, OneNote, PowerPoint, and Word as shown in the following table.

Platform Major Office version Subscription or one-time purchase? Notes
Windows Not applicable connected to Office 365 subscription Not available in OneNote
2019 one-time purchase Not available in OneNote
2016 one-time purchase Only available in Outlook on Exchange 2016 (requires post-release update) or later. Not available in Office other applications.
2013 one-time purchase Only available in Outlook on Exchange 2016 or later. Requires post-release updates for Outlook and Exchange 2016. Not available in other Office applications.
Mac Not applicable connected to Office 365 subscription Not available in OneNote
2019 one-time purchase Not available in OneNote
2016 one-time purchase Not available in OneNote
iOS Not applicable connected to Office 365 subscription Only available in Outlook
Android Not applicable connected to Office 365 subscription Only available in Outlook
web browser Not applicable Not applicable Available in all supported Office applications

## Understand the purpose of the add-in manifest

An Office add-in's XML manifest file defines the settings and capabilities of the add-in. You can configure it to control how your add-in is rendered and behaves in the targeted Office applications.

### What the manifest defines

• Add-in metadata (for example, ID, version, description, display name, default locale)
• Information about how the add-in integrates with Office (for example, target applications, custom functionality, add-in commands)
• Location of images the add-in should use for branding and command iconography
• Permissions that the add-in requires
• Dimensions of the add-in (for example, default dimensions for content add-ins, requested height for Outlook add-ins)
• Rules that specify when the add-in should activate in a message or appointment (Outlook only)

### How the manifest is used

An add-in manifest is used in the following ways:

• The Office applications where your add-in runs use information from the manifest to render add-in UI and wire up custom buttons or menu entries.
• Information from the manifest (name, description, author, logo, and so on) is used to create the app entry that's displayed to potential customers in AppSource.
• The AppSource validation process reads information from the manifest and validates that your add-in runs on expected platforms.

## Summary

The Office add-ins platform enables you to extend the functionality of Office applications. In this unit, you explored various ways you can use add-ins to extend and interact with Office applications. You also learned about configuring your add-in using the add-in's manifest file.