Programmatically configuring MS-Word's Trust Center settings using C#

Looks like I am going to answer my own question.

I have tested it and can confirm the mappings are as follows:

Macro Settings:

  • msoAutomationSecurityForceDisable = Disable all macros without notification

  • msoAutomationSecurityByUI = Disable all macros except digitally signed macros

  • msoAutomationSecurityLow = Enable all macros

To the best of my knowledge the global ActiveX settings can only be configured by directly editing the registry

ActiveX Disabled

[HKEY_CURRENT_USER\Software\Microsoft\Office\Common\Security] "DisableAllActiveX"=dword:00000001 "UFIControls"=dword:00000002

ActiveX Enabled with safe mode

[HKEY_CURRENT_USER\Software\Microsoft\Office\Common\Security] "DisableAllActiveX"=dword:00000000 "UFIControls"=dword:00000002

ActiveX Enabled without safe mode

[HKEY_CURRENT_USER\Software\Microsoft\Office\Common\Security] "DisableAllActiveX"=dword:00000000 "UFIControls"=dword:00000001

I have left a comment in the relevant section of the MSDN website


I know this thread is quite old, but I had to figure it out today so after a quick research I found this registry for the Trust Center Settings:

This applies to Word version 2010 (and probably 2007, but with 12.0 instead of 14.0)

enter image description here

Or in text:

Registry location:

HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Word\Security

Macro Settings:

Name: VBAWarnings

Data:

Disable all macros without notification - 4

Disable all macros with notification - 2

Disable all macros except digitally signed macros - 3

Enable all macros (...) - 1

Developer Macro Settings:

Name: AccessVBOM

Data:

Unchecked - 0

Checked - 1