Skip to content
Merged
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
4 changes: 4 additions & 0 deletions .openpublishing.redirection.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
"source_path": "docs/develop/grant-admin-consent-to-an-add-in.md",
"redirect_url": "/entra/identity-platform/quickstart-configure-app-access-web-apis#more-on-api-permissions-and-admin-consent"
},
{
"source_path": "docs/publish/custom-protocol-handler.md",
"redirect_url": "/office/dev/add-ins/publish/manage-trust-options"
},
{
"source_path": "docs/testing/debug-with-vs-extension.md",
"redirect_url": "/office/dev/add-ins/testing/debug-add-ins-overview"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Automatically open a task pane with a document
description: Learn how to configure an Office Add-in to open automatically when a document opens.
ms.topic: how-to
ms.date: 02/12/2025
ms.date: 09/22/2025
ms.localizationpriority: medium
---

Expand Down Expand Up @@ -58,7 +58,6 @@ Apply the following best practices when you use the autoopen feature.

Configure the manifest to specify the task pane page that should open automatically. The process depends on what type of manifest the add-in uses.


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

[!include[Unified manifest host application support note](../includes/unified-manifest-support-note.md)]
Expand Down Expand Up @@ -194,4 +193,5 @@ You can test the previous example by using your Microsoft 365 subscription to tr

- For a sample that shows you how to use the autoopen feature, see [Auto-open a task pane with a document](https://github.com/OfficeDev/Office-Add-in-samples/tree/main/Samples/office-add-in-commands/auto-open-task-pane).
- [Automatically open a task pane when an add-in is installed](automatically-open-on-installation.md)
- [Learn about the Microsoft 365 Developer Program](https://aka.ms/m365devprogram)
- [Learn about the Microsoft 365 Developer Program](https://aka.ms/m365devprogram)
- [Managing trust options for Office Add-ins](../publish/manage-trust-options.md)
5 changes: 3 additions & 2 deletions docs/develop/run-code-on-document-open.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
title: Run code in your Office Add-in when the document opens
description: Learn how to run code in your Office Add-in add-in when the document opens.
ms.topic: how-to
ms.date: 07/11/2023
ms.date: 09/22/2025
ms.localizationpriority: medium
---

# Run code in your Office Add-in when the document opens

[!include[Shared runtime requirements](../includes/shared-runtime-requirements-note.md)]

You can configure your Office Add-in to load and run code as soon as the document is opened. This is useful if you need to register event handlers, pre-load data for the task pane, synchronize UI, or perform other tasks before the add-in is visible.
You can configure your Office Add-in to load and run code as soon as the document is opened. This is useful if you need to register event handlers, pre-load data for the task pane, synchronize UI, or perform other tasks before the add-in is visible.

> [!NOTE]
> The configuration is implemented with a method that your code calls at runtime. This means that the add-in *won't* run the *first time* a user opens the document. The add-in must be opened manually for the first time on any document. After the method runs, either in [Office.initialize](/javascript/api/office#office-office-initialize-function(1)), [Office.onReady](/javascript/api/office#office-office-onready-function(1)), or because the user takes a code path that runs it; then whenever the document is reopened, the add-in loads immediately and any code in the `Office.initialize` or `Office.onReady` method runs.
Expand Down Expand Up @@ -110,3 +110,4 @@ let behavior = await Office.addin.getStartupBehavior();
- [Share data and events between Excel custom functions and task pane tutorial](../tutorials/share-data-and-events-between-custom-functions-and-the-task-pane-tutorial.md)
- [Work with Events using the Excel JavaScript API](../excel/excel-add-ins-events.md)
- [Runtimes in Office Add-ins](../testing/runtimes.md)
- [Managing trust options for Office Add-ins](../publish/manage-trust-options.md)
Original file line number Diff line number Diff line change
@@ -1,23 +1,49 @@
---
title: Trust custom protocol handlers that launch add-ins
description: How to use group policies for protocol handler trust in the registry to launch add-ins.
title: Managing trust options for Office Add-ins
description: How to disable trust prompts for users without installed add-ins and how to use group policies for protocol handler trust in the registry when launching add-ins.
ms.topic: how-to
ms.date: 08/15/2025
ms.date: 09/24/2025
ms.localizationpriority: medium
---

# Trust custom protocol handlers to launch add-ins
# Managing trust options for Office Add-ins

Office trust prompts help protect users by asking for consent before add-ins access their documents or launch from external protocols. While these security measures are important, there are scenarios where you don't want to prompt users to improve their experiences. This article covers how to disable trust prompts when the related add-in is not installed and how to configure protocol handler trust policies.

## Disable trust prompts for add-ins that aren't installed

When you share documents that contain add-in metadata, users without the required add-in installed may see trust prompts. These prompts appear when a document includes settings that instruct Office to automatically launch an add-in.

The following scenarios trigger trust prompts when the required add-in isn't installed.

- Documents with custom functions that use a [shared runtime](../develop/configure-your-add-in-to-use-a-shared-runtime.md).
- Documents configured to [automatically open a task pane](../develop/automatically-open-a-task-pane-with-a-document.md).
- Documents configured to [load add-ins when opened](../develop/run-code-on-document-open.md).

You can prevent these prompts from appearing for users who don't have your add-in installed. Disable trust prompts in your document by setting the [Settings.set](/javascript/api/office/office.settings#office-office-settings-set-member(1)) method to set the `"Office.DisableTrustUX"` setting to `true`.

```javascript
Office.context.document.settings.set("Office.DisableTrustUX", true);
Office.context.document.settings.saveAsync();
```

This setting is saved in the document's OOXML metadata. When enabled, it prevents trust prompts in all the scenarios listed earlier in this section. This provides a better experience for users who don't need the add-in.

> [!IMPORTANT]
> This setting only applies to Office on Windows and Mac.

## Trust custom protocol handlers to launch add-ins

Let your Office Add-in launch from a custom protocol handler (like `mailto:` or your own scheme) without prompting users for consent. This is useful when you want a seamless experience for users, or when your organization needs to centrally manage which add-ins launch from which protocols.

> [!IMPORTANT]
> This article applies to Windows only. Support for this feature starts with Office Version 2408 (Build 17928.20018).
> This section applies to Windows only. Support for this feature starts with Office Version 2408 (Build 17928.20018).

## How protocol handler trust works
### How protocol handler trust works

A protocol handler lets an app or add-in launch from a URI (for example, clicking a `mailto:` link opens your email client). Office add-ins also launch this way. By default, users are prompted to trust each add-in and protocol pair. As an admin, pre-approve or block these pairs using group policy and the Windows registry.

## Registry key format
### Registry key format

To automatically trust a custom protocol handler for an add-in, create a registry key at one of the following locations (replace `<add-in ID>` with your add-in's [manifest ID](/javascript/api/manifest/id) or unified manifest [`id`](/microsoft-365/extensibility/schema/root#id).

Expand All @@ -30,11 +56,11 @@ Add the following values to the key.
- **Type:** REG_SZ
- **Data:** `Allow` or `Block`

## Set group policies
### Set group policies

Admins use group policy to manage protocol handler trust across the organization. The following sample files show how to set up these policies.

### Sample ADMX file
#### Sample ADMX file

```xml
<?xml version="1.0" encoding="utf-16"?>
Expand Down Expand Up @@ -71,7 +97,7 @@ Admins use group policy to manage protocol handler trust across the organization
</policyDefinitions>
```

### Sample ADML file
#### Sample ADML file

```xml
<?xml version="1.0" encoding="utf-16"?>
Expand All @@ -94,7 +120,7 @@ Admins use group policy to manage protocol handler trust across the organization
</policyDefinitionResources>
```

### Sample .REG file
#### Sample .REG file

The following example shows how to configure the registry directly using a .REG file.

Expand Down
2 changes: 1 addition & 1 deletion docs/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ items:
- name: Maintain your Office Add-in
href: publish/maintain-breaking-changes.md
- name: Trust custom protocol handlers to launch add-ins
href: publish/custom-protocol-handler.md
href: publish/manage-trust-options.md

- name: Excel
items:
Expand Down