VBA or VBA for enabling macros ms word

2.1k Views Asked by At

I need a .vbs script to enable macros on ms word.

So every time the .vbs is run, the Macros should be enabled

Kindly help..

1

There are 1 best solutions below

1
Syberdoor On BEST ANSWER

The default registry key for macro security is

[HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Word\Security]
"VBAWarnings"=dword:00000001

You could set it with a script:

Set wso = CreateObject("WScript.Shell")
wso.RegWrite "HKCU\Software\Microsoft\Office\14.0\Word\Security\VBAWarnings", 1, "REG_DWORD"

and it would enable macros. This only works if Word is either closed when you run the script or restarted afterwards.

If you are in a company that uses GPOs to handle macro security it would probably be overwritten.