Bonjour à tous,
Me revoilà avec encore une question à propos de Mozilla Thunderbird. Je me rends compte que cette messagerie est difficile à piloter en VBA... mais bon pas le choix !
J'aimerai pourvoir joindre à mon message, tous les fichiers (5 ou 6) contenus dans un dossier spécifique. J'ai tenté avec ce code mais ça ne fonctionne pas :
Sub Envoyer_mail()
Dim destinataire, sujet, cc, chemin, monFichier, PJ As String
destinataire = Range("C6")
sujet = Range("C10")
cc = Range("c8")
body = Range("b13")
chemin = "C:\Users\user5\Desktop\Fichier\Envoi"
monFichier = Dir(chemin, vbNormal)
Do While monFichier <> ""
monFichier = Dir
PJ = monFichier
Loop
strcommand = "C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe"
strcommand = strcommand & " -compose " & "to='" & destinataire & "'"
strcommand = strcommand & "," & "subject=" & sujet & ","
strcommand = strcommand & "body='" & Chr(34) & body & Chr(34) & "'"
strcommand = strcommand & "," & "cc=" & cc
strcommand = strcommand & "," & "attachment='file:///" & PJ & "'"
Call Shell(strcommand, vbNormalFocus)
End Sub
Quelqu'un a une piste ?
Merci par avance,