2
0
In Microsoft Outlook 2013 under Windows 8.1 I have various rules which execute several VBA scripts.
For this I have:
Files → Options → Trust Center → Macrosettings → Activate all macros
And also the registry entry:
HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Outlook\Security
DWORD: EnableUnsafeClientMailRules
Value: 1
Now I want incoming RSS feeds to trigger the execution of a script as well, but I can't make it work. (I am sure, that this had worked a while ago (2 years?), but that was on a different computer, to which I have no access any more. Possible Microsoft "security update" once again?)
Anyway, to add RSS feeds, I used
Files → Account settings → RSS Feeds → New
One such feed is
http://rss.cnn.com/rss/edition_europe.rss
The feeds work nicely, and messages are obtained as desired. By default, they go into an automatically created folder beneath my mail account on the left hand pane:
myname@mydomain.com
...
RSS feeds
...
CNN Europe
Now to create a rule, I use the blank rule template to create a rule for messages received by me.
In there is a selectable condition "from arbitrary RSS feeds". I select it, and on the next page I select "execute a script". I select the intended script and finish the rule.
The feeds produce messages, but the script is never entered (I put a breakpoint on the first executable statement).
I tried to change the location into which the feeds go, by using an alternate destination, so as to make it appear as if the feeds are part of my inbox.
myname@mydomain.com
Inbox
...
RSS
...
CNN Europe
To no avail: the rule simply does not execute.
Any hints?
Apparently a security update has disabled scripts. Check first if the setting to
– harrymc – 2017-11-27T20:30:44.913EnableUnsafeClientMailRules
is still there or was somehow undone. You could also run the script directly via the NewMail or ItemAdd events, but it will need to be written in VBA.I just checked, it is still there. But that must have been so, because its absence would not allow the appearance of the checkbox item to execute a VBA script. Remember, the VBA scripts applied onto emails just work fine and as expected. But I can not apply any VBA script on a folder obtaining RSS feeds. There is no error or so, the script is just not entered. – Herb – 2017-11-28T06:46:15.920
@harrymc, I use the
MailItem
object as inPublic Sub ScanRSSPost(Item As Outlook.MailItem)
. Should I use another object? – Herb – 2017-11-28T06:51:48.857I have not done this myself, but I know that NewMail or ItemAdd are more often recommended in this case than MailItem. – harrymc – 2017-11-28T07:40:52.350
@harrymc, you guided me into the right direction. If you make a proper answer out of it, I'd attribute the answer and the bounty to you. Solution: (1)
Sub ScanRSSPost(Item As Outlook.PostItem)
, but this won't appear in the rules list. To make it appear, replacePostItem
byMailItem
which works, then (2) build the rule (on any RSS post, execute scriptScanRSSPost
), then (3) go back to the script and replaceMailItem
byPostItem
(Outlook won't complain), then COMMENT THAT PROCEDURE IN THE SCRIPT! Thanks, mate. – Herb – 2017-11-28T08:54:53.287