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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
Sub send_()
Dim f1 As Variant
Dim f2 As Variant
Dim f3 As Variant
Dim f4 As Variant
Dim f5 As Variant
Dim f6 As Variant
Dim f7 As Variant
Dim SML As Workbook
Dim M As Worksheet
Dim MLP As String, MLF As String
Dim n1, n2, n3, n4, n5, n6, n7 As Variant
Dim cm1 As Variant
Dim cm2 As Variant
Dim d1, d2, d3, d4, d5, d6, d7 As Variant
Dim day As Variant
Set M = Sheets("Date")
d1 = M.Range("A3")
d2 = M.Range("B3")
d3 = M.Range("C3")
d4 = M.Range("D3")
d5 = M.Range("E3")
d6 = M.Range("F3")
d7 = M.Range("G3")
f1 = (M.Range("A2") & d1 & M.Range("A4") & ".pdf")
cm1 = "C:\Users\Romain CAMPIOT\Dropbox\Mission management\GOS\Shared Exxon\Mission log\"
n1 = (cm1 & "ML-TTDAG-" & f1)
f2 = (M.Range("B2") & d2 & M.Range("B4") & ".pdf")
cm1 = "C:\Users\Romain CAMPIOT\Dropbox\Mission management\GOS\Shared Exxon\Mission log\"
n2 = (cm1 & "ML-TTDAG-" & f2)
f3 = (M.Range("C2") & d3 & M.Range("C4") & ".pdf")
cm1 = "C:\Users\Romain CAMPIOT\Dropbox\Mission management\GOS\Shared Exxon\Mission log\"
n3 = (cm1 & "ML-TTDAG-" & f3)
f4 = (M.Range("D2") & d4 & M.Range("D4") & ".pdf")
cm1 = "C:\Users\Romain CAMPIOT\Dropbox\Mission management\GOS\Shared Exxon\Mission log\"
n4 = (cm1 & "ML-TTDAG-" & f4)
f5 = (M.Range("E2") & d5 & M.Range("E4") & ".pdf")
cm1 = "C:\Users\Romain CAMPIOT\Dropbox\Mission management\GOS\Shared Exxon\Mission log\"
n5 = (cm1 & "ML-TTDAG-" & f5)
f6 = (M.Range("F2") & d6 & M.Range("F4") & ".pdf")
cm1 = "C:\Users\Romain CAMPIOT\Dropbox\Mission management\GOS\Shared Exxon\Mission log\"
n6 = (cm1 & "ML-TTDAG-" & f6)
f7 = (M.Range("G2") & d7 & M.Range("G4") & ".pdf")
cm1 = "C:\Users\Romain CAMPIOT\Dropbox\Mission management\GOS\Shared Exxon\Mission log\"
n7 = (cm1 & "ML-TTDAG-" & f7)
Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim CurFile1, CurFile2, CurFile3, CurFile4, CurFile5, CurFile6, CurFile7 As String
Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)
CurFile1 = n1
CurFile2 = n2
CurFile3 = n3
CurFile4 = n4
CurFile5 = n5
CurFile6 = n6
CurFile7 = n7
With olMail
.To = "flightops@rjm-aviation.com"
.Subject = "Flight documentation"
.Body = "Good day, please find enclosed pax manifest, escale report and airwaybill for this step. Best regards."
.Attachments.Add CurFile1
.Attachments.Add CurFile2
.Attachments.Add CurFile3
.Attachments.Add CurFile4
.Attachments.Add CurFile5
.Attachments.Add CurFile6
.Attachments.Add CurFile7
.Send
End With
MsgBox "Merci de vérifier que le message apparait dans -messages envoyés- dans votre messagerie OUTLOOK."
Set olMail = Nothing
Set olApp = Nothing
End Sub |
Partager