Passer du texte en gras

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 : " & 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

Il faut passer en HTML.

Essaie :

For i = 11 To 30
str = str & .Cells(i, 4) & " " & .Cells(i, 2) & " " & .Cells(i, 7) & "<br>"
Next i
End With
corps = "Bonjour, ci-joint le compte rendu de vacation. " & "<br>" & "<br>" & "<b>Références dossiers traités</b> : " & "<br>" & "<br>" & str & "<br>"

vacation avec un seul c

je ne vois pas Notes !

puis

.HtmlBody = corps 'le corps du mail ..son contenu

Bonjour Steelson, et merci!

Cela fonctionne, je me suis même permis de rajouter souligné et italique!

Merci également pour vacation, j'ai tendancce à abuser des c!

Notes n'était pas dans cette macro, mais je m'en suis arrangé!

En tout cas, encore merci!

N.

Rechercher des sujets similaires à "passer texte gras"