Re : envoi pièce jointe avec thunderbird impossible
Bonjour le forum, bonjour mromain, bonjour doublezero
doublezero
Dim destinataire, sujet, fichierjoint As String
Dim leNumero As String
Dim Filename As String
'onglet "Facture" exporter en .PDF
Sheets("Facture").ExportAsFixedFormat Type:=xlTypePDF, Filename:=ActiveWorkbook.Path & "\" & "Facture.pdf"
fichierjoint = ActiveWorkbook.Path & "\" & "Facture.pdf"
'destinataire = cellule a7 de l'onglet "Devis"
destinataire = Sheets("Devis").Range("a7") ' à adapter
'texte du message
sujet = "Facture"
text1 = "Veuillez trouvez ci-joint votre devis." & "<br><br>"
text2 = "Nous restons entièrement à votre disposition." & "<br><br>"
text3 = "Votre Responsable Commercial." & "<br><br>"
text4 = "Cordialement," & "<br><br>"
text5 = "BSI" & "<br>"
Body = text1 & text2 & text3 & text4 & text5
'pièce jointe : emplacement et nom du répertoire à adapter
strcommand = "C:\Program Files (x86)\Mozilla Thunderbird\Thunderbird"
strcommand = strcommand & " -compose " & "to='" & destinataire & "," ' Le destinataire
strcommand = strcommand & "'" & "," & "'"
strcommand = strcommand & "," & "subject=" & sujet & ","
strcommand = strcommand & "," & "body='" & Body & "," 'Corps du message
strcommand = strcommand & "," & "attachment=file:///" & fichierjoint ' Piece-jointe
Call Shell(strcommand, vbNormalFocus)
End Sub
l' approche se fait petit à petit
Pour avoir l' affichage du corps du message j' ai dû changer certains "'" en "," et par miracle tout apparait voir code ci-dessus
Par contre il y a un hic au niveau de la pièce jointe qui ne veut pas se placer dans thunderbird
je ne comprends pourquoi il faut créer un chemin pour pouvoir récupérer la pièce jointe sachant que c' est la feuille active du classeur qui doit se transformer en pdf et s' afficher en pièce jointe
Merci pour toute votre aide