Bonjour,
Je cherche à envoyer des mail thunderbird via Excel.
Le texte dans le corps est assez complexe avec des identifiants et des mots de passe biscornus je voudrais donc ne pas avoir à retrouver les coupes entre chacun et que les ; ou encore , voir me fasse le travail mais avec mon code, je n'ai qu'un long texte sans aucun saut de ligne:

Avec:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Sub Envoimail()
Dim Rep As Integer, destinataire As String, sujet As String, body As String, strcommand As String, TouchesEnvoi(5) As String, fichierjoint1 As String, fichierjoint2 As String, Message As String
 
 
destinataire = Range("D" & ActiveCell.Row)
fichierjoint1 = Range("U" & ActiveCell.Row).Value
fichierjoint2 = Range("V1").Value
Rep = MsgBox("Avez vous un texte particulier?", vbYesNo + vbQuestion, "Avez vous un texte particulier?")
    If Rep = vbNo Then
sujet = ActiveWorkbook.Name & " " & Range("A" & ActiveCell.Row).Value & " " & Range("B" & ActiveCell.Row).Value
 
 
 
body = Range("Q1").Value & vbCrLf & Range("R1").Value & ": " & Range("H" & ActiveCell.Row).Value & " " & Range("I" & ActiveCell.Row).Value & vbCrLf & vbCrLf & Range("J" & ActiveCell.Row).Value & vbCrLf & vbCrLf & Range("K" & ActiveCell.Row).Value & vbCrLf & vbCrLf & Range("L" & ActiveCell.Row).Value & vbCrLf & vbCrLf & Range("M" & ActiveCell.Row).Value & vbCrLf & vbCrLf & Range("N" & ActiveCell.Row).Value
Ou:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Sub Envoimail()
Dim Rep As Integer, destinataire As String, sujet As String, body As String, strcommand As String, TouchesEnvoi(5) As String, fichierjoint1 As String, fichierjoint2 As String, Message As String
 
 
destinataire = Range("D" & ActiveCell.Row)
fichierjoint1 = Range("U" & ActiveCell.Row).Value
fichierjoint2 = Range("V1").Value
Rep = MsgBox("Avez vous un texte particulier?", vbYesNo + vbQuestion, "Avez vous un texte particulier?")
    If Rep = vbNo Then
sujet = ActiveWorkbook.Name & " " & Range("A" & ActiveCell.Row).Value & " " & Range("B" & ActiveCell.Row).Value
 
 
 
Message = Range("Q1").Value & vbCrLf & Range("R1").Value & ": " & Range("H" & ActiveCell.Row).Value & " " & Range("I" & ActiveCell.Row).Value & vbCrLf & vbCrLf & Range("J" & ActiveCell.Row).Value & vbCrLf & vbCrLf & Range("K" & ActiveCell.Row).Value & vbCrLf & vbCrLf & Range("L" & ActiveCell.Row).Value & vbCrLf & vbCrLf & Range("M" & ActiveCell.Row).Value & vbCrLf & vbCrLf & Range("N" & ActiveCell.Row).Value
 
body = Message
Ou:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Sub Envoimail()
Dim Rep As Integer, destinataire As String, sujet As String, body As String, strcommand As String, TouchesEnvoi(5) As String, fichierjoint1 As String, fichierjoint2 As String, Message As String
Const retourChariot = VbCrLf 'Remplace VbCrLf ou Chr$()
 
destinataire = Range("D" & ActiveCell.Row)
fichierjoint1 = Range("U" & ActiveCell.Row).Value
fichierjoint2 = Range("V1").Value
Rep = MsgBox("Avez vous un texte particulier?", vbYesNo + vbQuestion, "Avez vous un texte particulier?")
    If Rep = vbNo Then
sujet = ActiveWorkbook.Name & " " & Range("A" & ActiveCell.Row).Value & " " & Range("B" & ActiveCell.Row).Value
 
body = Range("Q1").Value & retourChariot
body = body & Range("R1").Value & ": " & Range("H" & ActiveCell.Row).Value & " " & Range("I" & ActiveCell.Row).Value & retourChariot
body = body & Range("J" & ActiveCell.Row).Value & retourChariot
body = body & Range("K" & ActiveCell.Row).Value & retourChariot
body = body & Range("L" & ActiveCell.Row).Value & retourChariot
body = body & Range("M" & ActiveCell.Row).Value & retourChariot'body = body & Range("N" & ActiveCell.Row).Value

Je tourner en rond et strictement rien ne change à chaque essai

MERCI