Ouvrir dans l'explorateur

Turn off Trusted Documents for VBA macros

Cette stratégie n'a pas de traduction française dans les modèles de l'éditeur ; le texte original est en anglais.

Type
Utilisateur
Chemin GPO
Configuration utilisateur › Stratégies › Modèles d'administration › Microsoft Office 2016 › Paramètres de sécurité EN : User Configuration › Policies › Administrative Templates › Microsoft Office 2016 › Security Settings
Pris en charge sur
At least Windows Server 2016, Windows 10
Fichier ADMX
office16.admx
Nom interne
office16/L_BlockVBAMacroTrustedDocument

Explication

This policy setting allows you to turn off the Trusted Documents feature for documents containing VBA macros.

If you enable this policy setting, users will always see security notifications for VBA macros in documents. When users click "Enable Content" for VBA macros, Office will not create a trust record for the document, ensuring that the user is prompted every time they open the document.

If you disable or don't configure this policy setting, the Trusted Documents feature allows users to always allow VBA macros in a document so that the user is not prompted the next time they open that document. Trusted documents are exempt from security notifications.

Note: Enabling this policy setting does not clear existing trusted documents that were previously trusted.

Registre

HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\common\security
Nom de la valeur
blockvbamacrotrusteddocument
ÉtatValeur écrite
ActivéREG_DWORD = 1
DésactivéREG_DWORD = 0

PowerShell

Commandes PowerShell qui écrivent dans le registre ce que la stratégie écrirait. Les valeurs entre chevrons (<…>) sont à remplacer.

Écrire directement dans le registre contourne la stratégie de groupe : si une GPO gère cette valeur, elle sera réécrite au prochain gpupdate ; sinon la valeur reste en place (effet « tatouage »). Préférez une GPO ou, en local, LGPO.exe. Exécutez PowerShell en administrateur pour HKLM. Certaines stratégies demandent un redémarrage ou gpupdate /force.

Activer

# Activer : office16/L_BlockVBAMacroTrustedDocument
$k = 'HKCU:\software\policies\microsoft\office\16.0\common\security'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'blockvbamacrotrusteddocument' -Value 1 -Type DWord

Désactiver

# Désactiver : office16/L_BlockVBAMacroTrustedDocument
$k = 'HKCU:\software\policies\microsoft\office\16.0\common\security'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'blockvbamacrotrusteddocument' -Value 0 -Type DWord

Revenir à « Non configuré »

# Revenir à « Non configuré » : office16/L_BlockVBAMacroTrustedDocument
$k = 'HKCU:\software\policies\microsoft\office\16.0\common\security'
Remove-ItemProperty -Path $k -Name 'blockvbamacrotrusteddocument' -ErrorAction SilentlyContinue

Application

Microsoft 365 Apps / Office (Microsoft) — modèles de novembre 2026

Modèles officiels téléchargés le 12 novembre 2026.