Office users who use run-a-script rules are discovering their scripts are currently disabled (as is Start Application), thanks to a security update. When the update is installed, any existing run-a-script and run application rules will be disabled.
To fix, you need to set the EnableUnsafeClientMailRules value in the registry then restart Outlook.
Outlook 2016
HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\Security
DWORD: EnableUnsafeClientMailRules
Value: 1
Outlook 2013
HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Security
DWORD: EnableUnsafeClientMailRules
Value: 1
Outlook 2010
HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook\Security
DWORD: EnableUnsafeClientMailRules
Value: 1
If you don't want to edit the registry yourself, you can use this ready-to-use .reg file.
Outlook 2016/2019/365 Outlook 2013 Outlook 2010
One option is to convert the run-a-script to an ItemAdd macro. Depending on the conditions in your rule, converting it to an ItemAdd macro may be as simple as adding the application startup macro, renaming the script, and adding an If statement. For information on using ItemAdd macros, see How to use an ItemAdd Macro.
More Information
The option to "Run a Script" has disappeared from the Outlook rules
Thank you for all this work, and posting it so nicely and thoroughly!
I am in a secure environment, therefore I will not be able to by-pass the Run-a-Script security. I tried to run from macro using your code:
Sub SendNew(Item As Outlook.MailItem)
Dim objMsg As MailItem
Set objMsg = Application.CreateItemFromTemplate("C:\Users\RDGRLVAS\AppData\Roaming\Microsoft\Templates\fomas.oft")
objMsg.Recipients.Add Item.SenderEmailAddress
' Copy the original message subject
objMsg.Subject = "Before 1530et - Please provide input for weekly update to BC/DCs for FOMAS and associated 6.1" & Item.Subject
objMsg.Send
End Sub
------------------
I just paste it in the VvaProject.OTM-ThisOutlookSession (Code)
-----
I am not sure if I should put it somewhere else? but it doesn't run.
When you can't use it in a rule, you either need to use an itemadd macro or run the macro manually. You can use a 'stub' macro to process the currently selected item with the script.
It doesn't need to be in ThisOutlookSession if its not running automatically, but should work in either ThisOutlookSession or a new module.
I copied and paste the VBA to create a task after sending an email. When I say Yes I get an error message see attached. I did the registry thing and restarted Outlook but still get it. Please help
Sorry I missed this earlier. :( What macro are you using? The error 'Run-time error '438': Object doesn't support this property or method' indicates you are running the macro on a item that doesnt have the field the macro is looking for.
Why in O2016 list with scripts is empty?
What is the script title? Where is the script stored?
The title needs to be something like sub macroname(item as mailitem) to show in the script list. It should be in a module - while they will usually work in ThisOutlookSession, on occasion, they won't show up in the list.
have you saved the script in VBA window (Alt+F11) first?
Thank you! This got my rule and macro running again! While macros could be a security risk, for some of us they are definitely a time and labor saving feature!
Thanks again!
I found this works for Outlook 2010 as well. Recent security updates effectively killed some of my rules that ran scripts. I simply put the same value in the HKCU\Software\Microsoft\Office\14.0\Outlook\Security key.
I did discover that beyond simply exiting and restarting Outlook, it was necessary for me to restart my workstation completely before all functionality was restored.
So they disabled it in 2010 now too... i hoped it might escape. :(
Thank you for this registry edit. A recent security update rendered some of my Outlook 2010 rules disabled. Finding no other explanations, I tried inserting the "EnableUnsafeClientMailRules" value in the \Office\14.0 portion of the registry.
While I am now able to edit the rules and the Run a Script option is back in the actions portion of the rules editor, the macros will not run. They do not throw up any error messages, they just don't run. The trust center settings have not changed any, the macros have a trusted digital signature and the macro settings are set to prompt. I don't even get the prompt now. Any ideas are welcome and appreciated.
What does the script do? If you add msgbox "Rule is working" at the very top of the script, does it work?
Didn't work 2016, it worked before but this time no good, any ideas please?
You set the new registry key to allow run a script rules? You need to restart Outlook for it to take effect.
Thank you very much!! this was great info that solved my issue.