Skip to content

Commit 20e01d8

Browse files
authored
Merge pull request #5401 from OfficeDev/main
[admin] Publish
2 parents 0b57e10 + e442c87 commit 20e01d8

File tree

5 files changed

+48
-17
lines changed

5 files changed

+48
-17
lines changed

.openpublishing.redirection.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
"source_path": "docs/develop/grant-admin-consent-to-an-add-in.md",
99
"redirect_url": "/entra/identity-platform/quickstart-configure-app-access-web-apis#more-on-api-permissions-and-admin-consent"
1010
},
11+
{
12+
"source_path": "docs/publish/custom-protocol-handler.md",
13+
"redirect_url": "/office/dev/add-ins/publish/manage-trust-options"
14+
},
1115
{
1216
"source_path": "docs/testing/debug-with-vs-extension.md",
1317
"redirect_url": "/office/dev/add-ins/testing/debug-add-ins-overview"

docs/develop/automatically-open-a-task-pane-with-a-document.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Automatically open a task pane with a document
33
description: Learn how to configure an Office Add-in to open automatically when a document opens.
44
ms.topic: how-to
5-
ms.date: 02/12/2025
5+
ms.date: 09/22/2025
66
ms.localizationpriority: medium
77
---
88

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

5959
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.
6060

61-
6261
# [Unified manifest for Microsoft 365](#tab/jsonmanifest)
6362

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

195194
- 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).
196195
- [Automatically open a task pane when an add-in is installed](automatically-open-on-installation.md)
197-
- [Learn about the Microsoft 365 Developer Program](https://aka.ms/m365devprogram)
196+
- [Learn about the Microsoft 365 Developer Program](https://aka.ms/m365devprogram)
197+
- [Managing trust options for Office Add-ins](../publish/manage-trust-options.md)

docs/develop/run-code-on-document-open.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
title: Run code in your Office Add-in when the document opens
33
description: Learn how to run code in your Office Add-in add-in when the document opens.
44
ms.topic: how-to
5-
ms.date: 07/11/2023
5+
ms.date: 09/22/2025
66
ms.localizationpriority: medium
77
---
88

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

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

13-
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.
13+
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.
1414

1515
> [!NOTE]
1616
> 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.
@@ -110,3 +110,4 @@ let behavior = await Office.addin.getStartupBehavior();
110110
- [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)
111111
- [Work with Events using the Excel JavaScript API](../excel/excel-add-ins-events.md)
112112
- [Runtimes in Office Add-ins](../testing/runtimes.md)
113+
- [Managing trust options for Office Add-ins](../publish/manage-trust-options.md)
Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,49 @@
11
---
2-
title: Trust custom protocol handlers that launch add-ins
3-
description: How to use group policies for protocol handler trust in the registry to launch add-ins.
2+
title: Managing trust options for Office Add-ins
3+
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.
44
ms.topic: how-to
5-
ms.date: 08/15/2025
5+
ms.date: 09/24/2025
66
ms.localizationpriority: medium
77
---
88

9-
# Trust custom protocol handlers to launch add-ins
9+
# Managing trust options for Office Add-ins
10+
11+
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.
12+
13+
## Disable trust prompts for add-ins that aren't installed
14+
15+
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.
16+
17+
The following scenarios trigger trust prompts when the required add-in isn't installed.
18+
19+
- Documents with custom functions that use a [shared runtime](../develop/configure-your-add-in-to-use-a-shared-runtime.md).
20+
- Documents configured to [automatically open a task pane](../develop/automatically-open-a-task-pane-with-a-document.md).
21+
- Documents configured to [load add-ins when opened](../develop/run-code-on-document-open.md).
22+
23+
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`.
24+
25+
```javascript
26+
Office.context.document.settings.set("Office.DisableTrustUX", true);
27+
Office.context.document.settings.saveAsync();
28+
```
29+
30+
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.
31+
32+
> [!IMPORTANT]
33+
> This setting only applies to Office on Windows and Mac.
34+
35+
## Trust custom protocol handlers to launch add-ins
1036

1137
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.
1238

1339
> [!IMPORTANT]
14-
> This article applies to Windows only. Support for this feature starts with Office Version 2408 (Build 17928.20018).
40+
> This section applies to Windows only. Support for this feature starts with Office Version 2408 (Build 17928.20018).
1541
16-
## How protocol handler trust works
42+
### How protocol handler trust works
1743

1844
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.
1945

20-
## Registry key format
46+
### Registry key format
2147

2248
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).
2349

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

33-
## Set group policies
59+
### Set group policies
3460

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

37-
### Sample ADMX file
63+
#### Sample ADMX file
3864

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

74-
### Sample ADML file
100+
#### Sample ADML file
75101

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

97-
### Sample .REG file
123+
#### Sample .REG file
98124

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

docs/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ items:
479479
- name: Maintain your Office Add-in
480480
href: publish/maintain-breaking-changes.md
481481
- name: Trust custom protocol handlers to launch add-ins
482-
href: publish/custom-protocol-handler.md
482+
href: publish/manage-trust-options.md
483483

484484
- name: Excel
485485
items:

0 commit comments

Comments
 (0)