TaskMaster
Board Regular
- Joined
- Oct 15, 2020
- Messages
- 77
- Office Version
- 365
- 2016
- Platform
- Windows
Hi,
I'm wondering if anyone can help me. I have thrown together a simple spreadsheet that would list a series of tasks assigned to a person. When the task is overdue I'm wanting it to send an email reminder to that person. Unfortunately I get an error when using the following "There must be at least one name or contact group in the To, Cc, or Bcc box". Once I get to a stage where I can send emails, I would like if possible to have a dynamic body which lists the task(s) that are overdue for each person and when the due date is or by how many days its overdue.
Thanks in advance.
I'm wondering if anyone can help me. I have thrown together a simple spreadsheet that would list a series of tasks assigned to a person. When the task is overdue I'm wanting it to send an email reminder to that person. Unfortunately I get an error when using the following "There must be at least one name or contact group in the To, Cc, or Bcc box". Once I get to a stage where I can send emails, I would like if possible to have a dynamic body which lists the task(s) that are overdue for each person and when the due date is or by how many days its overdue.
Thanks in advance.
SQL:
Sub SendEmailReminder()
Dim OutlookApp As Object
Dim OutlookMailItem As Object
Dim iCounter As Integer
Dim MailDest As String
Set OutlookApp = CreateObject("Outlook.application")
Set OutlookMailItem = Outlook.CreateItem(0)
With OutlookMailItem
MailDest = ""
For iCounter = 1 To WorksheetFunction.CountA(Columns(12))
If MailDest = "" And Cells(iCounter, 12).Offset(0, -5) = "OVERDUE" Then
MailDest = Cells(iCounter, 12).Value
ElseIf MailDest <> "" And Cells(iCounter, 12).Offset(0, -5) = "OVERDUE" Then
MailDest = MailDest & ";" & Cells(iCounter, 12).Value
End If
Next iCounter
.To = MailDest
.Subject = "Overdue Tasks"
.Body = "Please review the checklist and complete overdue tasks"
.Send
End With
SetOutlookItem = Nothing
SetOutlookApp = Nothing
End Sub