Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 105 additions & 5 deletions docs/embedded/development/content-experiences/office-experience.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ ms.localizationpriority: high

# Office file experiences for SharePoint Embedded

Office file experiences for SharePoint Embedded platform will work in a similar manner to Microsoft 365 platform.
Office file experiences for the SharePoint Embedded platform work similarly to the Microsoft 365 platform.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend rephasing this to "Office files in SharePoint Embedded containers behave similarly to Office files stored in OneDrive and SharePoint sites."


## Opening Office documents from SharePoint Embedded

Office documents from SharePoint Embedded apps can be opened for viewing and editing in Office web or in the Office application for a richer viewing and editing experience. AutoSave feature saves your files automatically as your user's work and is enabled for each Word, Excel, and PowerPoint file stored in your SharePoint Embedded Application Apps.
Office documents from SharePoint Embedded apps can be opened for viewing and editing in Office web or in the Office application for a richer viewing and editing experience. The AutoSave feature saves files automatically as your users work and is enabled for each Word, Excel, and PowerPoint file stored in your SharePoint Embedded Application Apps.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend rephasing this to "Office documents in SharePoint Embedded apps can be opened and edited in Office for the web or in desktop Office applications for a richer experience. AutoSave is enabled by default, automatically saving changes to Word, Excel, and PowerPoint files as users work."

Copy link
Copy Markdown
Contributor

@tonchan-msft tonchan-msft Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Application" - I dont think application or the equivalent needs to be capitalized throughout the doc unless it is the first word in a sentence. Same for "Document" and "File".

"Application Apps" is redundant and should not be used. Please also standardize the usage of "application" vs "applications" vs "app" vs "apps", where applicable.


Documents stored in an archived container can’t be viewed or accessed. Applications must handle the archived state of the container by displaying an appropriate error message and guiding end users on the next steps to regain access, such as reactivating the container.
Copy link
Copy Markdown
Contributor

@tonchan-msft tonchan-msft Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not use the word "activate" in this context. Activate carries a specific meaning in SPE land. An archived container is already activated.

I would recommend rephasing this to "Documents in archived containers can’t be accessed or viewed. Applications should handle this state by displaying an appropriate message and guiding users on how to unarchive the container before access attempts."


Expand All @@ -21,10 +21,10 @@ Versioning is automatically enabled on each Word, Excel, and PowerPoint file sto

## Collaborating on Office documents from SharePoint Embedded

It's simple for your users to collaborate on your SharePoint Embedded Application's Office documents – they can **Share documents** with specific peers or with people outside your organization by Creating a shareable link to use wherever needed, Send an email invitation or @mention in comments to tag someone for feedback and, **Collaborate in real time** by co-authoring in Office with SharePoint Embedded Applications.
It's simple for your users to collaborate on your SharePoint Embedded Application's Office documents – they can **Share documents** with specific peers or with people outside your organization by creating a shareable link to use wherever needed, sending an email invitation or @mention in comments to tag someone for feedback and, **Collaborate in real time** by co-authoring in Office with SharePoint Embedded Applications.
Copy link
Copy Markdown
Contributor

@tonchan-msft tonchan-msft Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend rephasing this to "Users can share files with specific individuals or external users via links, email invitations, or @mentions in comments, and collaborate in real time through co-authoring in Office."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a public facing doc. Do not describe a process or interaction as easy, simple, hard or challenging. Just explain the steps 1, 2, 3 to achieve outcome X.


> [!NOTE]
> Mentions require target users to [have an Microsoft 365 license assigned to them](../auth.md#mention-users-in-office-documents).
> Mentions require target users to [have a Microsoft 365 license assigned to them](../auth.md#mention-users-in-office-documents).
>
> Mentions are restricted to people inside the consuming tenant's organization. Mentions exclude guests and users from other tenants in a multitenant setting.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it "Mentions" or "@mentions"?


Expand Down Expand Up @@ -74,6 +74,106 @@ Breadcrumb patterns for SharePoint Embedded Application Apps are constructed fro

![Screenshot of breadcrumb pattern in SharePoint Embedded Applications](../../images/office2.png)

Here are few examples of SharePoint Embedded Application breadcrumb display within Office client experiences.
Here are a few examples of SharePoint Embedded Application breadcrumb display within Office client experiences.

![Screenshot of breadcrumb options in SharePoint Embedded Applications.](../../images/office1.png)

## Controlling where users land when opening SPE files from Microsoft 365 search
Copy link
Copy Markdown
Contributor

@tonchan-msft tonchan-msft Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"SPE" - this is the first time using the acronym. Standard convention is to introduce the acronym along with its full name in the beginning of the article, as "SharePoint Embedded (SPE)", and then use SPE in the article as needed.


When users search for content on Microsoft 365 (for example, on Office.com or OneDrive), search results include files stored in SharePoint Embedded containers. Clicking a search result opens the file in an appropriate viewer. For file types without a built-in Microsoft viewer, the destination depends on whether your container type has a URL template configured.
Copy link
Copy Markdown
Contributor

@tonchan-msft tonchan-msft Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend rephasing this to "When users search across Microsoft 365 (such as on Office.com), results include files stored in SharePoint Embedded containers. Selecting a result opens the file in the appropriate viewer. For file types without a built-in Microsoft viewer, the destination depends on the container’s configured URL template."

You should also add a note that searchability across M365 is controlled by the container type configuration isDiscoverabilityDisabled.


The `urlTemplate` property on your container type lets you specify a URL pattern in your application that Microsoft 365 uses as the destination when a user clicks on one of your files stored in your containers in search results. Without it, users clicking non-Office, non-PDF files in search results are directed to a generic Microsoft help page rather than your application.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend rephasing this to "The urlTemplate property on a container type specifies the URL pattern used by Microsoft 365 when users open files from search results. If no URL template is configured, users clicking non-Office and non-PDF files are directed to a generic Microsoft help page rather than your application."


### How file types are handled

The destination URL for a file in search results depends on the file type, regardless of whether `urlTemplate` is set:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"regardless of whether urlTemplate is set" is not entirely true, is it?

Copy link
Copy Markdown
Contributor

@tonchan-msft tonchan-msft Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should rephase as "Selecting SPE content from search results has different behaviors, dependent on the file type and the urlTemplate setting:"


| File type | `urlTemplate` set? | Destination when clicked in search |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rephase "Destination when clicked in search" to "Behavior"

|---|---|---|
| Word, Excel, PowerPoint | Yes or No | Opens in Office Web Apps |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rephase "Yes or No" to Either

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Word, Excel, PowerPoint" - what do they mean exactly? Word files can be docx, docm, etc. Excel can be xlsx, xlsm, xlsb, xls - would csv (which can be commonly opened on excel) be supported via this?

| PDF and other files supported by the embedded viewer | Yes or No | Opens in the embedded file viewer |
Copy link
Copy Markdown
Contributor

@tonchan-msft tonchan-msft Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rephase "Yes or No" to Either

What are "the other files supported by the embedded viewer"? I think we should provide a list of supported file formats supported by the embedded viewer. It currently reads as "PDF and something else" and we are not telling you what that something else is.

Should it be "other files" or "other file types"?

| All other types (.txt, custom extensions, etc.) | Yes | Redirected to your application via the resolved `urlTemplate` |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"All other types (.txt, custom extensions, etc.)" I would recommend rephase this to "Txt files and all other file types, including custom extensions"

| All other types (.txt, custom extensions, etc.) | No | Redirected to `https://aka.ms/spe-openfilelocation` |

### Configuring `urlTemplate`

Set `urlTemplate` on your container type using the [Update fileStorageContainerType](/graph/api/filestoragecontainertype-update) API. The value is a URL with placeholder tokens that Microsoft 365 resolves to actual item identifiers at the time a user clicks a search result.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend rephasing this to "Set the urlTemplate property on your container type using the Update fileStorageContainerType API. This value defines a URL pattern with placeholder tokens that Microsoft 365 resolves to the appropriate item identifiers when a user selects a file from search results."


#### URL template syntax

```
https://app.contoso.com/open?tenant={tenant-id}&drive={drive-id}&item={item-id}
```

Tokens are enclosed in curly braces and replaced with values for the specific item the user clicked. Any token that cannot be resolved is removed from the URL before the redirect occurs.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rephase "clicked" to "selected"


#### Supported tokens

| Token | Value your app receives |
|---|---|
| `{tenant-id}` | ID of the consuming tenant; use to make tenant-scoped Graph API calls |
| `{drive-id}` | Drive ID of the container; use with the Graph Files API to reference the container |
Copy link
Copy Markdown
Contributor

@tonchan-msft tonchan-msft Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "Graph Files API" is wrong. There is no Graph resource called Files.

| `{folder-id}` | ID of the item's immediate parent folder; may be absent for root-level files |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"May be absent" rephase to "unrequired"

| `{item-id}` | ID of the file; combine with `{drive-id}` and the Graph Files API to open or retrieve the file |
Copy link
Copy Markdown
Contributor

@tonchan-msft tonchan-msft Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "Graph Files API" is wrong. There is no Graph resource called Files.


You can also use container custom properties as tokens, as long as the custom property was created with `isPatternToken: true`. The token format is `{propertyName}` where `propertyName` is the key of the custom property.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"You can also use container custom properties as tokens, as long as the custom property was created with isPatternToken: true" rephase to "You can also use container custom properties as tokens, only if they were created with isPatternToken: true"


For more information on custom property tokens, see [Custom properties on fileStorageContainers](/graph/api/filestoragecontainer-post-customproperty).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"For more information on custom property token" rephased to "For more information on custom properties".

"custom property tokens" is not a SPE supported entity.


#### Example

If your container type has `urlTemplate` set to:

```
https://app.contoso.com/open?t={tenant-id}&d={drive-id}&i={item-id}
```

Then when a user clicks a `.txt` file in a search result, they are redirected to something like:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Then when a user clicks a .txt file in a search result," rephase to "Then when a user opens a .txt file from search result,"


```
https://app.contoso.com/open?t=72f988bf-86f1-41af-91ab-2d7cd011db47&d=b%21abc123...&i=01ABC...
```

Your application receives the tenant ID, drive ID, and item ID as query parameters and can use them to open the correct file using the Microsoft Graph Files API.
Copy link
Copy Markdown
Contributor

@tonchan-msft tonchan-msft Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Microsoft Graph Files API" - do we mean "Microsoft Graph driveItem APIs"?

Copy link
Copy Markdown
Contributor

@tonchan-msft tonchan-msft Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Your application receives the tenant ID, drive ID, and item ID as query parameters and can use them to open the correct file using the Microsoft Graph Files API." - I recommend rephasing this to "Your application receives a URL with the tenantId, driveId, and driveItemId populated and can call the Microsoft Graph driveItem APIs to open the file.

Copy link
Copy Markdown
Contributor

@tonchan-msft tonchan-msft Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One note on consistency - "tenant-id" vs "tenant ID" and the like. Please stick with one convention throughout. I recommend either "tenant-id" or "tenantId" but not "tenant ID". No space when we are referring to the variables.


#### Setting `urlTemplate` via the Graph API
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Setting urlTemplate via the Graph API" - remove "the"


Use a PATCH request to update the container type:

```http
PATCH https://graph.microsoft.com/v1.0/storage/fileStorage/containerTypes/{containerTypeId}
Content-Type: application/json

{
"settings": {
"urlTemplate": "https://app.contoso.com/open?t={tenant-id}&d={drive-id}&i={item-id}"
},
"etag": "<etag-value>"
Copy link
Copy Markdown
Contributor

@tonchan-msft tonchan-msft Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to include etag as part of the example?

}
```

For the full reference, see [Update fileStorageContainerType](/graph/api/filestoragecontainertype-update).
Copy link
Copy Markdown
Contributor

@tonchan-msft tonchan-msft Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"For the full reference" rephase to "For details on how to update fileStorageContainerType"


### Fallback behavior when `urlTemplate` is not set

If `urlTemplate` is not configured on your container type, users who click on non-Office, non-PDF files in Microsoft 365 search results are redirected to `https://aka.ms/spe-openfilelocation`. This page explains that the file is stored in a third-party application and that the user should open it there directly.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i recommend rephasing this to "If the urlTemplate property isn’t configured, users who select non-Office or non-PDF files in Microsoft 365 search results are redirected to a generic help page that explains the file is stored in a third-party application and should be opened there."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"search results are redirected to https://aka.ms/spe-openfilelocation. This page explains that the file is stored in a third-party application and that the user should open it there directly." - is this true?

Currently "https://aka.ms/spe-openfilelocation" redirects to "https://learn.microsoft.com/en-us/sharepoint/dev/embedded/development/content-experiences/office-experience". I think a screenshot for https://aka.ms/spe-openfilelocation would be helpful here


If your application stores only Word, Excel, PowerPoint, and PDF files, you may not need to set `urlTemplate` at all. For applications that store any other file types, setting `urlTemplate` is strongly recommended to avoid users encountering this help page from search.
Copy link
Copy Markdown
Contributor

@tonchan-msft tonchan-msft Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"If your application stores only Word, Excel, PowerPoint, and PDF files, you may not need to set urlTemplate at all." - lets avoid using may or may not, It suggests the need of it depends on the circumstances, and we need to explain the circumstances (which we are not doing in this article) or imply the partners to trial and error (which is bad).

Copy link
Copy Markdown
Contributor

@tonchan-msft tonchan-msft Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually dont think this line is needed at all. Wouldn't the table above suffice? Instead, if a section to talk about fallback is needed, we should just say 1) there is no fallback for WXP files, redirecting them to Office is the only option; 2) there is no fallback to PDF files, redirecting them to embedded viewer is the only option; and 3) non WXP and PDF files fallback to the help page if the urlTempalte is unset.


### Limitations

#### Search index updates require a re-crawl
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Search index updates require a re-crawl" rephase to "Updates to the urlTemplate are not instantaneous"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we must use the word recrawl, use" recrawl" instead of "re-crawl." That is the word used across other articles.


The destination URL for each file is stored in the Microsoft 365 search index when the file is crawled. If you configure or update `urlTemplate` after files have already been indexed, existing search results continue to route to the previous destination until those files are re-crawled. Microsoft 365 performs incremental crawls automatically, but there may be a delay before all files reflect the updated URL.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The destination URL for each file is stored in the Microsoft 365 search index when the file is crawled." - drop "when the file is crawled"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"If you configure or update urlTemplate after files have already been indexed, existing search results continue to route to the previous destination until those files are re-crawled. Microsoft 365 performs incremental crawls automatically, but there may be a delay before all files reflect the updated URL." rephase to "If you configure or update the urlTemplate after files have been indexed, search results will continue to use the previous destination until the index is updated. Microsoft 365 performs incremental index update automatically, but there may be a delay before updates are reflected."


#### `urlTemplate` is scoped to the container type, not individual containers
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can drop "not individual containers"


The template applies to all containers of that type across all consuming tenants. Use the `{tenant-id}` token to route users to the correct tenant context within your application.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The template applies to all containers of that type across all consuming tenants" rephase to "The template applies to all container instances of the corresponding container type across all consuming tenants."

"Use the {tenant-id} token to route users to the correct tenant context within your application." drop the word "context".


#### Custom property tokens require `isPatternToken: true`

Container custom properties are only eligible for use as URL tokens if they were created with `isPatternToken: true`. Properties without this flag cannot be used in the template.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Container custom properties are only eligible for use as URL tokens if they were created with isPatternToken: true. " rephase to "Container custom properties can only be used as URL tokens if they were created with isPatternToken: true. "

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to explain if there is a way to update an existing custom property and set isPatternToken to true,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading this article again, why is this subsection needed? Didnt we already talk about the token piece earlier in the article?


#### `{folder-id}` reflects the item's immediate parent

For files at the root of the container, this token may not resolve and is removed from the final URL. Design your application to handle URLs where `{folder-id}` is absent.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"For files at the root of the container, this token may not resolve" - this is leaving room for misinterpretation as it also reads "the token may resolve" and we are suggesting folks to trial and error. If it indeed does not resolve, say so. If it resolves in some circumstances and does not in others, explain the circumstances.

33 changes: 32 additions & 1 deletion docs/embedded/development/tutorials/using-file-preview.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: File Previews
description: Preview SharePoint Embedded content
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this article centered around PDF experience only?

ms.date: 05/21/2024
ms.date: 04/22/2026
ms.localizationpriority: high
---

Expand Down Expand Up @@ -101,3 +101,34 @@ async function preview(driveId, itemId) {
document.getElementById('preview').src = response + "&nb=true"; //Use nb=true to suppress banner
}
```

## PDF Preview

SharePoint Embedded includes a PDF previewer that you can enhance with query parameters appended to the driveItem's `webUrl` property. To get `webUrl`, call the [driveItem Graph endpoint](/graph/api/resources/driveitem) and retrieve the `webUrl` field.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

" PDF previewer" - we referred to this as "embedded previewer" in the other article. Can we standardize the naming convention?


The parameters are passed as a JSON-encoded `embed` query string:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"query string" - is this a query string or object? The next line refers to this as an object.


```text
<webUrl>&embed={"<param1>":<value>,"<param2>":<value>}
```

You can include one or more parameters in the same object.

> [!NOTE]
> Additional query parameters will be added to this section as the PDF previewer expands.

### Print (`mpp`)

Enables the print icon and Ctrl+P functionality.

```text
<webUrl>&embed={"mpp":true}
```

### Sticky Notes (`mpsn`)

Shows sticky note content if sticky notes are present in the PDF.

```text
<webUrl>&embed={"mpsn":true}
```