VBA Macro Notification Settings: registry value vbawarnings and 3 more (word\security)UserHKCU\software\policies\microsoft\office\16.0\word\security

Policy ID
L_VBAWarningsPolicy
Scope
User Configuration
Supported on
At least Windows Server 2008 R2 or Windows 7
Source
Microsoft 365 Apps / Office Administrative Templates (version 5568.1000)
Category
Microsoft Word 2016 › Word Options › Security › Trust Center

Registry

vbawarnings

REG_DWORDUser
Enabled value
Depends on the option value
Element
-
Options
ItemStored value
Disable all with notification2
Disable all except digitally signed macros3
Disable all without notification4
Enable all macros (not recommended)1
Apply with .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\word\security]

; Options (use only one)
; Disable all with notification
"vbawarnings"=dword:00000002
; Disable all except digitally signed macros
"vbawarnings"=dword:00000003
; Disable all without notification
"vbawarnings"=dword:00000004
; Enable all macros (not recommended)
"vbawarnings"=dword:00000001
CMD
:: Options (use only one)

:: Disable all with notification
reg add "HKCU\software\policies\microsoft\office\16.0\word\security" /v "vbawarnings" /t REG_DWORD /d 2 /f
:: Disable all except digitally signed macros
reg add "HKCU\software\policies\microsoft\office\16.0\word\security" /v "vbawarnings" /t REG_DWORD /d 3 /f
:: Disable all without notification
reg add "HKCU\software\policies\microsoft\office\16.0\word\security" /v "vbawarnings" /t REG_DWORD /d 4 /f
:: Enable all macros (not recommended)
reg add "HKCU\software\policies\microsoft\office\16.0\word\security" /v "vbawarnings" /t REG_DWORD /d 1 /f
PowerShell
# Common: create the key
New-Item -Path 'HKCU:\software\policies\microsoft\office\16.0\word\security' -Force | Out-Null

# Options (use only one)
# Disable all with notification
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\word\security' -Name 'vbawarnings' -PropertyType DWord -Value 2 -Force | Out-Null
# Disable all except digitally signed macros
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\word\security' -Name 'vbawarnings' -PropertyType DWord -Value 3 -Force | Out-Null
# Disable all without notification
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\word\security' -Name 'vbawarnings' -PropertyType DWord -Value 4 -Force | Out-Null
# Enable all macros (not recommended)
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\word\security' -Name 'vbawarnings' -PropertyType DWord -Value 1 -Force | Out-Null

vbadigsigtrustedpublishers

REG_DWORDUser
Checked
1
Unchecked
0
Element
Require macros to be signed by a trusted publisher
Value type
REG_DWORD
Apply with .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\word\security]

; Options (use only one)
; Checked
"vbadigsigtrustedpublishers"=dword:00000001
; Unchecked
"vbadigsigtrustedpublishers"=dword:00000000
CMD
:: Options (use only one)

:: Checked
reg add "HKCU\software\policies\microsoft\office\16.0\word\security" /v "vbadigsigtrustedpublishers" /t REG_DWORD /d 1 /f
:: Unchecked
reg add "HKCU\software\policies\microsoft\office\16.0\word\security" /v "vbadigsigtrustedpublishers" /t REG_DWORD /d 0 /f
PowerShell
# Common: create the key
New-Item -Path 'HKCU:\software\policies\microsoft\office\16.0\word\security' -Force | Out-Null

# Options (use only one)
# Checked
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\word\security' -Name 'vbadigsigtrustedpublishers' -PropertyType DWord -Value 1 -Force | Out-Null
# Unchecked
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\word\security' -Name 'vbadigsigtrustedpublishers' -PropertyType DWord -Value 0 -Force | Out-Null

vbarequirelmtrustedpublisher

REG_DWORDUser
Checked
1
Unchecked
0
Element
Block certificates from trusted publishers that are only installed in the current user certificate store
Value type
REG_DWORD
Apply with .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\word\security]

; Options (use only one)
; Checked
"vbarequirelmtrustedpublisher"=dword:00000001
; Unchecked
"vbarequirelmtrustedpublisher"=dword:00000000
CMD
:: Options (use only one)

:: Checked
reg add "HKCU\software\policies\microsoft\office\16.0\word\security" /v "vbarequirelmtrustedpublisher" /t REG_DWORD /d 1 /f
:: Unchecked
reg add "HKCU\software\policies\microsoft\office\16.0\word\security" /v "vbarequirelmtrustedpublisher" /t REG_DWORD /d 0 /f
PowerShell
# Common: create the key
New-Item -Path 'HKCU:\software\policies\microsoft\office\16.0\word\security' -Force | Out-Null

# Options (use only one)
# Checked
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\word\security' -Name 'vbarequirelmtrustedpublisher' -PropertyType DWord -Value 1 -Force | Out-Null
# Unchecked
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\word\security' -Name 'vbarequirelmtrustedpublisher' -PropertyType DWord -Value 0 -Force | Out-Null

vbarequiredigsigwithcodesigningeku

REG_DWORDUser
Checked
1
Unchecked
0
Element
Require Extended Key Usage (EKU) for certificates from trusted publishers
Value type
REG_DWORD
Apply with .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\word\security]

; Options (use only one)
; Checked
"vbarequiredigsigwithcodesigningeku"=dword:00000001
; Unchecked
"vbarequiredigsigwithcodesigningeku"=dword:00000000
CMD
:: Options (use only one)

:: Checked
reg add "HKCU\software\policies\microsoft\office\16.0\word\security" /v "vbarequiredigsigwithcodesigningeku" /t REG_DWORD /d 1 /f
:: Unchecked
reg add "HKCU\software\policies\microsoft\office\16.0\word\security" /v "vbarequiredigsigwithcodesigningeku" /t REG_DWORD /d 0 /f
PowerShell
# Common: create the key
New-Item -Path 'HKCU:\software\policies\microsoft\office\16.0\word\security' -Force | Out-Null

# Options (use only one)
# Checked
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\word\security' -Name 'vbarequiredigsigwithcodesigningeku' -PropertyType DWord -Value 1 -Force | Out-Null
# Unchecked
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\word\security' -Name 'vbarequiredigsigwithcodesigningeku' -PropertyType DWord -Value 0 -Force | Out-Null