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
|
Application.EnableEvents = False
Application.Calculation = xlCalculationAutomatic
Workbooks("erreurs1803xlsx.xlsm").Activate
Sheets("ENVOI").Select
Dim Rep As Integer, destinataire As String, sujet As String, body As String, strcommand As String, TouchesEnvoi(5) As String
destinataire = Sheets(ActiveSheet.Index).Range("G2")
sujet = ConverAcute(Sheets("COMMUNICATION").Range("A1").Value)
body = ConverAcute(Sheets("COMMUNICATION").Range("B1").Value)
fichierjoint1 = ActiveWorkbook.Path & "\PUBLIP\" & Sheets(ActiveSheet.Name).Range("A2") & ".xls"
Debug.Print fichierjoint1
strcommand = "C:\Program Files\Mozilla Thunderbird\thunderbird"
strcommand = strcommand & " -compose " & "to='" & destinataire & "'"
strcommand = strcommand & "," & "subject=" & sujet & ","
strcommand = strcommand & "body=" & body
strcommand = strcommand & "," & "attachment=file:///" & fichierjoint1
Call Shell(strcommand, vbNormalFocus)
Application.Wait (Now + TimeValue("0:00:05"))
Dim LastCol As Long
LastCol = 11 'Cells(ActiveCell.Row, Cells.Columns.Count).End(xlToLeft).Column - 4
UltLig = ThisWorkbook.Sheets("ENVOI").Range("A500000").End(xlUp).Row
ThisWorkbook.Sheets("ENVOI").Range(Cells(1, 1), Cells(UltLig, LastCol)).Select
Selection.Copy
Application.Wait (Now + TimeValue("0:00:05"))
SendKeys "{DOWN 9}"
SendKeys ("^+O")
Application.Wait (Now + TimeValue("0:00:05"))
SendKeys "^{ENTER}", True
Application.ThisWorkbook.Activate
If NumLock = False Then NumLock = True
Application.EnableEvents = True
End Sub |
Partager