Outlook rule with macro quit firing

0

So, I set a rule in Outlook that whenever an e-mail from a specific source (our IPS alerting system) it would fire the below macro to save the attachment to my disk for further automated scripting love. This worked great for about a week, but now all of a sudden, the attachments are no longer getting saved to the drive, and I have no idea how to even try and troubleshoot it. The only thing I can think of (incoming address changing, as that was the rule base) has been ruled out, as the address is still exactly the same. Any help on what I can do to try and poke at it would be greatly appreciated.

Public Sub saveAttachtoDisk(itm As Outlook.MailItem)
Dim objAtt As Outlook.Attachment
Dim saveFolder As String
saveFolder = "c:\Users\Arvandor\Documents\ips_alerts"
     For Each objAtt In itm.Attachments
          objAtt.SaveAsFile saveFolder & "\" & objAtt.DisplayName
          Set objAtt = Nothing
     Next
End Sub

Arvandor

Posted 2015-12-23T17:25:03.830

Reputation: 43

Code looks fine and I assume it hasn't changed. What version of Outlook? Have the security settings been changed? Is the rule definitely still working, try and add something simple (like a move to folder or mark as high importance or similar). Does the folder definitely exist? Any permission changes been made on that? Any new antivirus software that might be blocking it? Any other relevant info from around the time it stopped working? – Jonno – 2015-12-23T17:31:50.617

Those e-mails were already being filtered into a folder, and that's still working. It's Office 365, no idea on updates etc, no anti-virus changes. Folder still exists (I can still right click- save as and run the script on my other machine, which can mount the folder no problem; to pull the files over just dandy). No permission changes that I'm aware of... Myself, system, and local admins all still have full control. – Arvandor – 2015-12-23T17:40:05.013

Is the macro getting fired and not just saving the file, or is the macro not being fired? – Ƭᴇcʜιᴇ007 – 2015-12-23T18:10:12.697

I wish I knew how to tell... But I don't, and that's part of the problem. – Arvandor – 2015-12-23T18:50:13.253

Answers

0

I figured out my issue. Somehow (and how this would happen without user intervention, I have no idea), the folder filter had the "and stop processing more rules" option checked. That or it was always there, and the order of the rules got changed somehow, so before it was downloading the attachment and THEN sorting it, then after a reboot or something the list got resorted. I don't know, but it's fixed now. I actually just put the script and sort into a single rule that still has the stop processing rule flag.

Arvandor

Posted 2015-12-23T17:25:03.830

Reputation: 43

0

"Stop processing rules" is a nice finish to a rule to ensure that subsequent rules don't undo the good work that your rule has performed. I've rarely used sequential, separate rules in Outlook; have never had to.

So to ensure that your intended actions aren't interrupted or disrupted by new rules added later, try to put all your conditions and actions into a single rule, then tell Outlook "stop" once executing that rule. (FYI, for less technical readers, the "stop processing rules" action only fires IF the conditions for the rule are matched. Otherwise, Outlook continues looking for conditions that match the new message going down the list of rules.)

Chromejob

Posted 2015-12-23T17:25:03.830

Reputation: 1