Hi Hyperbole,
Try this amended code
Sub Send_Mail()
Dim rng As Range
Dim cel As Range
Dim LastCel As String
Dim szToday As String
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
LastCel = Range("D65536").End(xlUp).Address
szToday = Format(Date, "dd/mm/yyyy")
Set rng = Range("D8:" & LastCel)
For Each cel In rng
If DateDiff("d", cel, Now) > 30 And cel.Offset(0, 1).Value = "" Then
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
strbody = "Please take note you have not responded to the letter sent by " & Range("C1").Value & " as registered in the Letter Register."
On Error Resume Next
With OutMail
.To = Range("F1").Value
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = strbody
'.Send 'or use
.Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
Else
End If
Next cel
End Sub
Of course that code would have to be placed in the Workbook_Open part of your book. Post back if you need any help in that direction
Bookmarks