Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Excel PowerPoint] (content addins) add support for unified manifest #4668

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
39 changes: 37 additions & 2 deletions docs/design/content-add-ins.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Content Office Add-ins
description: Content add-ins are surfaces that can be embedded directly into Excel or PowerPoint documents that give users access to interface controls that run code to modify documents or display data from a data source.
ms.date: 06/27/2024
ms.date: 09/26/2024
ms.topic: overview
ms.localizationpriority: medium
---
Expand Down Expand Up @@ -41,11 +41,46 @@ For Mac, the personality menu measures 26x26 pixels, but floats 8 pixels in from

## Implementation

There are minor differences in the manifests between content add-ins and add-ins that use task panes.
There are minor differences in the manifests between content add-ins and add-ins that use task panes. Open the tab for the type of manifest you're using.

# [Unified manifest for Microsoft 365](#tab/jsonmanifest)

> [!NOTE]
> The unified manifest is available in Excel, PowerPoint, and Word as a developer preview. For Outlook, it's generally available and can be used in production add-ins.

Configure the manifest with the following steps.

1. Add a "contentRuntimes" child array to the extension object in the "extensions" array.
1. Remove the "runtimes" property if it is present. The "runtimes" array is for task pane or mail add-ins. These cannot be combined with a content add-in.
1. Add an anonymous content runtime object in the "contentRuntimes" array.
1. Set the "id" property of the object to a descriptive name.
1. Set the "code.page" object to the full URL of the custom content that you want to embed in the document.
1. Optionally, set the "requestedWidth" and "requestedHeight" properties to a size between 32 and 1000 pixels. If these properties aren't used, the Office application determines the size.
1. Optionally, set the "disableSnapshot" property to `true` to prevent Office from saving a snapshot of the content component with the document.

The following is an example of a "contentRuntimes" property.

```json
"contentRuntimes": [
{
"id": "ContentRuntime",
"code": {
"page": "https://localhost:3000/content.html"
},
"requestedWidth": 100,
"requestedHeight": 100,
"disableSnapshot": true,
}
]
```

# [XML Manifest](#tab/xmlmanifest)

- For the **\<[OfficeApp](/javascript/api/manifest/officeapp)\>** element, set the `xsi:type` attribute to `"ContentApp"`.
- In the **\<[DefaultSettings](/javascript/api/manifest/defaultsettings)\>** element, add the **\<[RequestedHeight](/javascript/api/manifest/requestedheight)\>** and **\<[RequestedWidth](/javascript/api/manifest/requestedwidth)\>** elements.

---

For a sample that implements a content add-in, see [Excel Content Add-in Humongous Insurance](https://github.com/OfficeDev/Excel-Content-Add-in-Humongous-Insurance) on GitHub.

To create your own content add-in, see the [Excel content add-in quick start](../quickstarts/excel-quickstart-content.md) and [PowerPoint content add-in quick start](../quickstarts/powerpoint-quickstart-content.md).
Expand Down