• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Enable script containing VBA

Outlook version
Outlook 2007
Email Account
POP3
#3
Run a script rules are automatic - they get called by the rule. did you check the macro security setting? An update may have changed it.

Thanks for response.

Not sure I understand completely.

I hadn't used VBA scripts in Outlook 2016. Took me ages to actually find how to. Eventually got running yesterday but today not working. Don't think Microsoft has actually changed anything / update since yesterday. Suspect some settings have gottten reset .

I guess Microsoft feels security could be compromised but making life so difficult is just a real pain!
 
Outlook version
Outlook 2007
Email Account
POP3
#4
Thanks for response.

Not sure I understand completely.

I hadn't used VBA scripts in Outlook 2016. Took me ages to actually find how to. Eventually got running yesterday but today not working. Don't think Microsoft has actually changed anything / update since yesterday. Suspect some settings have gottten reset .

I guess Microsoft feels security could be compromised but making life so difficult is just a real pain!
The rule appears to run (no error) - the message gets moved to a new folder but the VBA script appears to be ignored
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#5
Go to File, options, Trust center and check the macro security setting. It will sometimes work with security set to block macros when you first set up a macro (and not warn you) then die on a restart.
 
Outlook version
Outlook 2007
Email Account
POP3
#6
Go to File, options, Trust center and check the macro security setting. It will sometimes work with security set to block macros when you first set up a macro (and not warn you) then die on a restart.
Diane thanks for the response.

I have attached 2 files -
1 - showing the Rule - i.e. it moves the file to another folder (which it does) followed by the script which is VBA and takes the item.body and places in a file then creates a file with a list of all files to process. This code has a breakpoint early in the code so I know it never gets started
2 - showing the security settings which I believe you refer to

As previously stated 2 -3 days ago everything worked as required - so just not aware of what may have changed
 

Attachments

Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#7
showing the Rule - i.e. it moves the file to another folder (which it does) followed by the script which is VBA and takes the item.body and places i
oh.... scripts should do it all. if you have two actions, the script may not run
 
Outlook version
Outlook 2007
Email Account
POP3
#8
oh.... scripts should do it all. if you have two actions, the script may not run
Diane,

News to me !
I have had several rules constructed in a similar manner - i.e. the basics within the rule and other tasks (unable to complete within a rule) in the script.
I guess I could make the changes but doesn't really answer why I could perform the rule on previous occasions - last week and on older version of Outllook. Unless there is some 'real' reason not to create my rule (which has worked) then I suspect making these changes will not solve the problem.

The creating of a rule in Outlook doesn't mention this restriction / suggestion so far as I am aware. Specifically when creating a rule there is a section
"What do you want to to do with the message?" - there are perhaps 15+ options one is "move to the specified folder [allows you to select a folder]" and a second is "Run a script [allows you to select a script - if present]".

I am sure you are aware of the above but just trying to 'get to a solution'
 
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#9
Its hard to say why it worked then and not now, but the advice has always been to use conditions in the rule, actions in the script. The problem is in controlling which action happens first and whether the rule loses control of the message after the first action runs.

Are you using the script in one rule? if you are only moving to one folder, you can add the move to the script easily enough. if you have multiple rules moving messages, you can still do it, but will need to use a new script for each rule.
 
Outlook version
Outlook 2007
Email Account
POP3
#10
Hi Diane,
Thanks again. Again I notice that '.. the advice...'. I haven't seen any documentation suggesting that all actions are in a script (not to say there isn't any information somewhere). As stated previously to action a script is just one of many options to select with no suggestion that it should be 'the only' selection.

Non the less I have modified the script to make the change but don't know the result just yet. [the email messages are output from an MT4 Forex platform - the Forex market does not operate over the weekend].
 
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#11
I don't know if Microsoft ever had it documented, but if they did, the KB article is probably long gone. Programmers who have worked with run a script rules have known about it for years.
I mention it at Outlook's Rules and Alerts: Run a Script and Sue Mosher mentioned it at outlookcode.com.
 

Similar threads