Hi All,
I am trying to automate task list by setting Send reminder if task is pending by using the below code:
For Outlook:
Sub SendReminderMail()
Dim OutLookApp As Object
Dim OutLookMailItem As Object
Dim iCounter As Integer
Dim MailDest As String
Set OutLookApp = CreateObject("Outlook.application")
Set OutLookMailItem = OutLookApp.CreateItem(0)
With OutLookMailItem
MailDest = ""
For iCounter = 1 To WorksheetFunction.CountA(Columns(10))
If MailDest = "" And Cells(iCounter, 10).Offset(0, -1) = "Send Reminder" Then
MailDest = Cells(iCounter, 10).Value
ElseIf MailDest <> "" And Cells(iCounter, 10).Offset(0, -1) = "Send Reminder" Then
MailDest = MailDest & ";" & Cells(iCounter, 10).Value
End If
Next iCounter
.To = MailDest
.Subject = "FYI"
.Body = "Reminder: Your task is due."
.Send
End With
Set OutLookMailItem = Nothing
Set OutLookApp = Nothing
End Sub
But, am getting an error like at least one user email should be mentioned and I want to set levels like if task is pending for 2 days - sendmail to level-1, 3 days - level-2 and more than 3 days level-3.
From Gmail - I don't know how to send for multiple recipients.
Please if anyone can help me on this I will very thankful to them.
Thanks in advance
I am trying to automate task list by setting Send reminder if task is pending by using the below code:
For Outlook:
Sub SendReminderMail()
Dim OutLookApp As Object
Dim OutLookMailItem As Object
Dim iCounter As Integer
Dim MailDest As String
Set OutLookApp = CreateObject("Outlook.application")
Set OutLookMailItem = OutLookApp.CreateItem(0)
With OutLookMailItem
MailDest = ""
For iCounter = 1 To WorksheetFunction.CountA(Columns(10))
If MailDest = "" And Cells(iCounter, 10).Offset(0, -1) = "Send Reminder" Then
MailDest = Cells(iCounter, 10).Value
ElseIf MailDest <> "" And Cells(iCounter, 10).Offset(0, -1) = "Send Reminder" Then
MailDest = MailDest & ";" & Cells(iCounter, 10).Value
End If
Next iCounter
.To = MailDest
.Subject = "FYI"
.Body = "Reminder: Your task is due."
.Send
End With
Set OutLookMailItem = Nothing
Set OutLookApp = Nothing
End Sub
But, am getting an error like at least one user email should be mentioned and I want to set levels like if task is pending for 2 days - sendmail to level-1, 3 days - level-2 and more than 3 days level-3.
From Gmail - I don't know how to send for multiple recipients.
Please if anyone can help me on this I will very thankful to them.
Thanks in advance