Sub NotifySuccessorResources() Dim lngPercentTHold As Long 'Holds the threshold for firing the email Dim tTask As Task 'Will represent the Task Dim tSucc As Task 'Will represent the Successor(s) to the Task Dim rRcs As Resource 'Will reprent the resources assigned to the Successor Dim aAssign As Assignment 'Will represent the Assignments to the Successor Dim olApp As Outlook.Application 'The Outlook Application Object Dim olMailMessage As Outlook.MailItem 'The Outlook mail object Dim olRecipient As Outlook.Recipient 'The Message Recipients object Dim blnKnownRecipient As Boolean 'Flag for if the new Recipient is a valid email Dim blnNewOutlookApp As Boolean 'Flag for if this macro had to open Outlook or it 'was already open 'Initialize blnNewOutlookApp to False blnNewOutlookApp = False 'Set the Percent Complete threshold 'The number here will be the Percent Complete at which mail will be sent lngPercentTHold = 90 Const ERR_APP_NOTRUNNING As Long = 429 On Error Resume Next ' Attempt to reference running instance of Outlook. Set olApp = GetObject(, "Outlook.Application") ' If Outlook isn't running, create a new instance. If Err = ERR_APP_NOTRUNNING Then Set olApp = New Outlook.Application 'Set the blnNewOutlookApp to true so that it can be shut down later blnNewOutlookApp = True End If 'Loop through all the tasks in the project For Each tTask In ActiveProject.Tasks 'If Percent complete is equal to or greater than the value set AND Text30 is not equal 'to "Sent" then go forward If tTask.PercentComplete >= lngPercentTHold And tTask.Text30 <> "Sent" Then 'Loop through the Successors of the task For Each tSucc In tTask.SuccessorTasks 'Loop through all the assignments to the successor task For Each aAssign In tSucc.Assignments 'Create a new message Set olMailMessage = olApp.CreateItem(olMailItem) With olMailMessage 'Add the email address of the resource on the Assignment to the email Set olRecipient = .Recipients.Add(ActiveProject.Resources(aAssign.ResourceID).EMailAddress) 'Resolve the address blnKnownRecipient = olRecipient.Resolve 'Set the subject of the message .Subject = "Task Start Alert for Project: " & Left$(ActiveProject.Name, (Len(ActiveProject.Name) - 4)) 'Set the Body of the message .Body = "The Task Called '" & tSucc.Name & "' is due to begin on " & _ tSucc.Start & _ Chr(13) & Chr(13) & "'" & tSucc.Name & " has a 'Predecessor' task called '" & _ tTask.Name & "' that is due to finish on " & tTask.Finish & _ " and is now " & tTask.PercentComplete & "% complete." & _ Chr(13) & Chr(13) & _ "YOUR assignment to '" & tSucc.Name & "' is scheduled to begin on " _ & aAssign.Start & " and end on " & aAssign.Finish & "." & Chr(13) & _ "It is scheduled to take " & aAssign.Work / 60 & " hours of work." & Chr(13) & Chr(13) & _ "Please be aware that your work on '" & tSucc.Name & _ "' will begin soon." & Chr(13) & Chr(13) & "Thank You." 'Check to see if the email address resolved 'if it did then send the message 'if it did not then display the message If blnKnownRecipient = True Then .Send Else .Display End If 'Clear the Message object Set olMailMessage = Nothing 'Set the Text30 field of the task to Sent so that 'the next time this macro runs it will not send the note again tTask.Text30 = "Sent" End With Next aAssign Next tSucc End If Next tTask 'Check to see if this macro had to create an instance of Outlook 'if it DID then close it 'If it did not (meaning that one was already running) then do nothing If blnNewOutlookApp = True Then olApp.Quit Set olApp = Nothing End If End Sub