Besoin de passer du Texte en gras dans un mail

noel33

XLDnaute Occasionnel
Bonjour à tous,

Dans cette macro ci dessous, j'aimerai que les mots "Notes" et "Références dossiers traités : " qui font parti du corps d'un Mail soient en Gras .... vous avez une idée SVP?

D'avance merci !

N.

Sub Test()
Dim ObjOutlook As New Outlook.Application
Dim oBjMail
Dim i As Long, str As String, corps As String, Nom_Fichier As String

Set ObjOutlook = New Outlook.Application
Set oBjMail = ObjOutlook.CreateItem(olMailItem)
'---------------------------------------------------------
'Exemple pour envoyer un classeur en pièce jointe
'Nom_Fichier = Application.GetOpenFilename("Fichier excel (*.xls;*.xlsx;*.xlsm), *.xls;*.xlsx;*.xlsm")
'If Nom_Fichier = "Faux" Then Exit Sub
'---------------------------------------------------------
'Ou bien entrer le path et nom du fichier autrement
Nom_Fichier = "C:\Users\XXX\Desktop\Compte rendu.xlsm"
If Nom_Fichier = "" Then Exit Sub
'---------------------------------------------------------
With Feuil1
For i = 11 To 30
str = str & .Cells(i, 4) & " " & .Cells(i, 2) & " " & .Cells(i, 7) & vbLf
Next i
End With
corps = "Bonjour, ci-joint le compte rendu de vaccation. " & vbLf & vbLf & "Références dossiers traités : [/color]" & vbLf & vbLf & str & vbLf

With oBjMail
.To = "XXXX@XXXX.com" ' le destinataire
.CC = "XXYYXX@XXXX.com"
.Subject = "Compte rendu vaccation du " & Format(Date, "dd mmmm yyyy") & " " & .Range("p2").Value ' l'objet du mail
.Body = corps 'le corps du mail ..son contenu
'.Attachments.Add Nom_Fichier '"C:\Data\essai.txt" ' ou Nomfichier
.Display ' Ici on peut supprimer pour l'envoyer sans vérification
'.Send
End With
'ObjOutlook.Quit
Set oBjMail = Nothing
Set ObjOutlook = Nothing
End Sub
 

Roland_M

XLDnaute Barbatruc
Bonsoir,

essaies comme ceci

'début message = "<HTML><BODY>"
'fin message = "</BODY></HTML>"
'retour ligne = "<BR>"
'gras = "<b>"
'fin gras = "</b>"

Corps = "<HTML><BODY> Bonjour, ci-joint le compte rendu de vaccation.<BR><BR>" & _
"<b>Références dossiers traités : </b><BR><BR></BODY></HTML>"
 

Discussions similaires

Réponses
2
Affichages
203

Statistiques des forums

Discussions
312 111
Messages
2 085 407
Membres
102 884
dernier inscrit
Macarena