Hi everyone,
I have dateline in date format in cell C13, and the following is my codes. How can I auto send a reminder email 3 days prior to the dateline in C13?
Thanks,
I have dateline in date format in cell C13, and the following is my codes. How can I auto send a reminder email 3 days prior to the dateline in C13?
Thanks,
Code:
Dim OutApp As Object Dim OutMail As Object
Dim strbody As String
Dim sTO As String, sSubj As String, sCC As String
sCC = Range("C9")
sTO = Range("C32")
sSubj = Range("C3")
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strbody = " Hi there, " & vbNewLine & vbNewLine & _
"You have received a PO Trouble Ticket - " & Range("C3") & vbNewLine & _
"Please visit https://extranet.jll.com/sites/HSBC/Services/afs/Working%20Documents/Forms/AllItems.aspx?RootFolder=%2Fsites%2FHSBC%2FServices%2Fafs%2FWorking%20Documents%2FPO%20Issue%20Tracker&FolderCTID=0x012000486DB623C21B3C49888E334CB16B75B5&View=%7B1CE984E7%2D73AA%2D419E%2D90AD%2DDE14E1B702F6%7D to resolve the issue." & vbNewLine & _
"Please add your conmmentary in the {Resolution} section." & vbNewLine & vbNewLine & _
"Thanks" & vbNewLine & _
Range("C8")
On Error Resume Next
With OutMail
.To = sTO
.CC = ""
.BCC = ""
.Subject = "[IMPORTANT] " & sSubj
.Body = strbody
.send
End With
debugs:
If Err.Description <> "" Then MsgBox Err.Description
End Sub