Outlook Rule not running script on SharePoint Alert

Hello All, 

I created a VBA script that I want to place in a rule in outlook. The script will be triggered by an email alert from SharePoint.

The script goes out to a file, and essentially saves it to my desktop. I ran the script on its own and it works fine. I also created a simple rule in outlook and told it to run the script which that also works.

The problem is when trying to add it to a share point alert email. That specific email for some reason wont trigger the VBA script. I've tried a few different rules involving the SharePoint alert email that I would be receiving and each time it will not run the VBA script associated with it, even though the script will work with other rules.  

Any help with this would be greatly appreciated! Thank you! 

July 30th, 2015 8:21am

Hi,

How did you create the rule to involve the SharePoint alert email? How did you specify the rule conditions? We'll appreciate it if you could provide a screenshot of the rule.

Does a simple Outlook rule work with the SharePoint alert email? Such as move the SharePoint alert email to a specified folder?

Do you have any other Outlook rules that may conflict with the script rule? 

Please provide more information so that we can fix the issue more efficiently.

Best Regards,

Steve Fan
TechNet Community Support

Free Windows Admin Tool Kit Click here and download it now
July 31st, 2015 4:51am

The rule I created, I right clicked on the alert email directly and created an alert rule. It did not assign it to the category nor run the script like this.

Then I created the following: 

Apply This rule after the message arrives 

from SP,SQl Service and with Reference in the subject and on this computer only 

   move it to the TEST folder 

and run Script. 

(Sorry, my account won't allow me to post images until it has been verified

A more simple rule, which I created from scratch. It moves it to the folder i designated, but does not run the script.

I have two version of a script. Both ways work independently of an outlook rule as opposed with rules when I test emailing to myself. This has been the one, I've been trying to use.

I disabled the only other rule that might affect it, and this rule is at the top of the list to run first.   

Thank you for the help, please let me know what other information you may need.

Sub PhoneList_ThroughOutlook(item As Outlook.MailItem)
     
     ' Ignore the incoming item to be safe.
     
    Dim newItem As MailItem
    Dim Atmt As Attachment
    Dim FileName As String
     
    Set newItem = CreateItem(olMailItem)
     
   newItem.Attachments.Add "\\controller.alleghenycounty.us\DavWWWRoot\Employee Phone List\Office Phone Directory List.doc"
   

    For Each Atmt In newItem.Attachments
         ' do not save images that may be in your signature
        If InStr(1, Atmt.FileName, "Office Phone Directory List.doc") Then
             
             ' If not Citrix
             'FileName = Environ("USERPROFILE") & "\Desktop\" & Atmt.FileName
             
             ' If Citrix
            FileName = "C:\Users\T105739\Desktop\office phone directory list.doc"
             
            Atmt.SaveAsFile FileName
            Exit For
             
        End If
    Next Atmt
     
    newItem.Close olDiscard
    Set Atmt = Nothing
    Set newItem = Nothing
     
End Sub


July 31st, 2015 8:08am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics