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
| Sub sendthunderbird()
Dim destinataire, sujet As String, body
Dim i As Integer
With Sheets("Réservations")
i = 2
While .Cells(1, i) <> ""
destinataire = .Cells(2, i)
sujet = "Reserva " & .Cells(4, i)
body = "Hola%0A Le confirmo la reserva siguiente:%0A%0A" & _
"Email : " & destinataire & "%0A" & _
"Hotel : " & .Cells(3, i) & "%0A" & _
"Cliente : " & .Cells(4, i) & "%0A" & _
"Fecha de entrada : " & .Cells(5, i) & "%0A" & _
"Fecha de salida : " & .Cells(6, i) & "%0A" & _
"Numero noches : " & .Cells(7, i) & "%0A" & _
"Numero pax : " & .Cells(8, i) & "%0A" & _
"Observaciones : " & .Cells(13, i) & "%0A%0A" & _
"Confirmar lo antes posible la reserva. Gracias y un saludo"
strcommand = "C:\Program Files (x86)\Mozilla Thunderbird\thunderbird"
strcommand = strcommand & " -compose " & "to='" & destinataire & "'"
strcommand = strcommand & "," & "subject=" & sujet & ","
strcommand = strcommand & "body=" & body
'strcommand = strcommand & "," & "attachment=file:///" & fichierjoint
Call Shell(strcommand, vbNormalFocus)
i = i + 1
Wend
End With
End Sub |
Partager