Open in the explorer

Block macros from running in Office files from the internet

Type
User
GPO path
User Configuration › Policies › Administrative Templates › Microsoft Word 2016 › Word Options › Security › Trust Center
Supported on
At least Windows Server 2008 R2 or Windows 7
ADMX file
word16.admx
Internal name
word16/L_BlockMacroExecutionFromInternet

Explanation

This policy setting allows you to block macros from running in Office files that come from the internet.

If you enable this policy setting, macros are blocked from running, even if "Enable all macros" is selected in the Macro Settings section of the Trust Center. Users will receive a notification that macros are blocked from running.

The exceptions when macros will be allowed to run are:
- The Office file is saved to a Trusted Location.
- The Office file was previously trusted by the user.
- Macros are digitally signed and the matching Trusted Publisher certificate is installed on the device.

If you disable this policy setting, the settings configured in the Macro Settings section of the Trust Center determine whether macros run in Office files that come from the internet.

If you don’t configure this policy setting, macros will be blocked from running. Users will receive a notification telling them of the security risks of macros from the internet along with a link to learn more.

For more information, see https://go.microsoft.com/fwlink/p/?linkid=2185771.

Use cases

Blocks VBA macros in Office files that come from the Internet (marked with the Mark of the Web): users see a "Security Risk" banner with no button to enable content. In Word, this blocks macros in templates and documents received by email or downloaded, while macros in files stored in a trusted location or signed by a trusted publisher keep working.

Microsoft recommends enabling this setting (it is part of the Microsoft 365 Apps for enterprise security baseline); legitimate macros must come from a trusted location, be signed, or be unblocked, for example with Unblock-File. These policies require Microsoft 365 Apps for enterprise.

Microsoft source: Macros from the internet are blocked by default in Office

Registry

HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\word\security
Value name
blockcontentexecutionfrominternet
StateValue written
EnabledREG_DWORD = 1
DisabledREG_DWORD = 0

PowerShell

PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.

Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.

Enable

# Enable: word16/L_BlockMacroExecutionFromInternet
$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 'blockcontentexecutionfrominternet' -Value 1 -Type DWord

Disable

# Disable: word16/L_BlockMacroExecutionFromInternet
$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 'blockcontentexecutionfrominternet' -Value 0 -Type DWord

Revert to "Not configured"

# Revert to "Not configured": word16/L_BlockMacroExecutionFromInternet
$k = 'HKCU:\software\policies\microsoft\office\16.0\word\security'
Remove-ItemProperty -Path $k -Name 'blockcontentexecutionfrominternet' -ErrorAction SilentlyContinue

Application

Microsoft 365 Apps / Office (Microsoft) — November 2026 templates

Official templates downloaded on November 12, 2026.