Ouvrir dans l'explorateur

Trust access to Visual Basic Project

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 Word 2016 › Options Word › Sécurité › Centre de gestion de la confidentialité EN : User Configuration › Policies › Administrative Templates › Microsoft Word 2016 › Word Options › Security › Trust Center
Pris en charge sur
At least Windows Server 2008 R2 or Windows 7
Fichier ADMX
word16.admx
Nom interne
word16/L_TrustaccesstoVisualBasicProject

Explication

This policy setting controls whether automation clients such as Microsoft Visual Studio 2005 Tools for Microsoft Office (VSTO) can access the Visual Basic for Applications project system in the specified applications. VSTO projects require access to the Visual Basic for Applications project system in Excel, PowerPoint, and Word, even though the projects do not use Visual Basic for Applications. Design-time support of controls in both Visual Basic and C# projects depends on the Visual Basic for Applications project system in Word and Excel.

If you enable this policy setting, VSTO and other automation clients can access the Visual Basic for Applications project system in the specified applications. Users will not be able to change this behavior through the "Trust access to the VBA project object model" user interface option under the Macro Settings section of the Trust Center.

If you disable this policy setting, VSTO does not have programmatic access to VBA projects. In addition, the "Trust access to the VBA project object model" check box is cleared and users cannot change it. Note: Disabling this policy setting prevents VSTO projects from interacting properly with the VBA project system in the selected application.

If you do not configure this policy setting, automation clients do not have programmatic access to VBA projects. Users can enable this by selecting the "Trust access to the VBA project object model" in the "Macro Settings" section of the Trust Center. However, doing so allows macros in any documents the user opens to access the core Visual Basic objects, methods, and properties, which represents a potential security hazard.

Registre

HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\word\security
Nom de la valeur
accessvbom
É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 : word16/L_TrustaccesstoVisualBasicProject
$k = 'HKCU:\software\policies\microsoft\office\16.0\word\security'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'accessvbom' -Value 1 -Type DWord

Désactiver

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

Revenir à « Non configuré »

# Revenir à « Non configuré » : word16/L_TrustaccesstoVisualBasicProject
$k = 'HKCU:\software\policies\microsoft\office\16.0\word\security'
Remove-ItemProperty -Path $k -Name 'accessvbom' -ErrorAction SilentlyContinue

Application

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

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