For a PCI-related product we have recently installed, I’ve needed to run a script that reads an Outlook mailbox and analyze the message content. Nothing special, but Outlook stops script with the following message
Pretty quickly I have found that I need to change the Programmatic Access settings in Outlook Trust Center. The problem is that all the settings are greyed out
None of the recommended registry changes helped. So, I have opened a case with Microsoft that has given me even more information than I expected to get
First thing first:
Outlook 2007 and later does not allow running the scripts on the systems without or with outdated antivirus. Outlook relies on OS API and needs OS response to find out whether the antivirus is installed and running.
However, believe you or not, only client OS has such API. No, Windows Server does not have it. And yes, I have tried to run my script against Outlook installed on Windows Server. Even though I started with Office support, we have involved the Server support specialist, who has confirmed that Outlook scripting does not work on Windows Server without the warning. No way, by design.
So, I moved over to Windows 7
Here the registry value
DWORD:ObjectModelGuard = 2
in the key
does the trick.
More interesting, that playing with Outlook in Windows Server we tried many values in the same registry key. Try one of these if ObjectModelGuard does not work for you
PromptOOMItemPropertyAccess = 2
PromptOOMSend = 2
PromptOOMAddressBookAccess = 2
PromptOOMAddressInformationAccess = 2
PromptOOMFormulaAccess = 2
PromptOOMAddressUserPropertyFind = 2
PromptSimpleMAPISend = 2
PromptSimpleMAPIOpenMessage = 2
PromptSimpleMAPINameResolve = 2
AdminSecurityMode = 3