1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| Sub test1()
Dim appOutLook As Object
Dim MailOutLook As Object
Dim strbody As String
Set appOutLook = CreateObject("Outlook.Application")
Set MailOrigine = GetCurrentItem
Set MailOutLook = GetCurrentItem.ReplyAll
Dat = MailOrigine.ReceivedTime
Tim = DateAdd("d", 1, Dat)
Tim1 = DateAdd("d", 2, Dat)
Dat = Format(Dat, "dd/mm/yyyy")
If Dat < "09:00" Then
strbody = "<BODY style=font-size:12pt;font-family:Calibri> Bonjour, <br>" _
& "<br>" _
& "<BODY style=font-size:12pt;font-family:Calibri>Nous vous confirmons la date du " & Tim1 & ". <br>" _
& "<br>" _
& "<BODY style=font-size:12pt;font-family:Calibri>Cordialement." & "<br>" _
Else
strbody = "<BODY style=font-size:12pt;font-family:Calibri> Bonjour, <br>" _
& "<br>" _
& "<BODY style=font-size:12pt;font-family:Calibri>Nous vous confirmons la date du " & Tim & ". <br>" _
& "<br>" _
& "<BODY style=font-size:12pt;font-family:Calibri>Cordialement." & "<br>" _
End If
With MailOutLook
.Display
.Subject = "Confirmation Date"
.Recipients.ResolveAll
.HTMLBody = strbody & "<br>" & .HTMLBody
.Display
End With
Set MailOutLook = Nothing
Set appOutLook = Nothing |
Partager