Anyone reading this please help me as I just cannot get my head rounds this problem.
I have a macro that sends out an automated email chaser for emails that are at 3 days, 6 days and 10 days but the day count has to be buisness days so I have tried to use the IIf(Weekday(Date) < 1, 2, 0) to get rid of the weekends but I jsut cannot get it straight in my mind how to configure the last part of the formula.
So If my email is actually 6 days old and it was sent last Thursday and I am run the macro today (Monday) how do I get it to work out that it is in fact only 3 days old and not 6 days
This is the current code
Select Case Now - f.items(eindex).SentOn
Case Is > 10 - IIf(Weekday(Date) > 1, 2, 0) ' Move Emails over 10 days to No Reply Recieved
f.items(eindex).Categories = Replace(f.items(eindex).Categories, "Pending Sales Response - Macro", "No Response Received")
f.items(eindex).Save
'**********************************************************************
Case Is > 9 - IIf(Weekday(Date) > 1, 2, 0)
Case Is > 8 - IIf(Weekday(Date) > 1, 2, 0)
Case Is > 7 - IIf(Weekday(Date) > 1, 2, 0)
'**********************************************************************
Case Is > 6 - IIf(Weekday(Date) < 1, 2, 0) ' Send final chaser for all emails over 6 days
Set Original = f.items(eindex)
Set r = Original.ReplyAll
r.Attachments.Add Original
r.SentOnBehalfOfName = "xxx"
r.CC = "xxx" & ""
r.Subject = "Urgent Chaser 2 - " & f.items(eindex).Subject
r.Body = "Please provide a response to the attached email or the request/action will be archived due to no response."
r.Display ' Change to send
'**********************************************************************
Case Is > 5 - IIf(Weekday(Date) < 6, 2, 0)
Case Is > 4 - IIf(Weekday(Date) < 5, 2, 0)
'**********************************************************************
Case Is > 3 - IIf(Weekday(Date) < 4, 2, 0) ' Send initial chaser for all emails over 3 days
Set Original = f.items(eindex)
Set r = f.items(eindex).ReplyAll
r.Attachments.Add Original
r.SentOnBehalfOfName = "xxx"
'r.CC = " " Can be set to cc Sales
r.Subject = "Urgent Chaser 1 - " & f.items(eindex).Subject
r.Body = "Please provide a response to the attached email." '& f.Items(eindex).Body
r.Display ' Change to Send
End Select