Le 08/12/21 à 09:51, MichD a écrit :
Pour le plaisir, j'ai remplacé le texte contenu dans l'item .HTMLBODY
par des variables. Au besoin, on peut remplacer ce texte des variables
par une référence d'une adresse de cellule.
'-----------------------------------------------------------
Sub SendEmailformattext10()
Dim xOutApp As Outlook.Application
Dim xMailOut As Outlook.MailItem
Dim Sujet As String
Dim Salutation As String
Dim Texte As String, TexteCouleur As String, texte2 As String
Dim Destinataire As String
'---------------------------------------------------
'Définir le texte pour chacune de ces variables.
Destinataire = "Joséph...@Gmail.com"
Sujet = "Je ne sais pas..."
Titre = "Bonjour Monsieur"
Texte1 = "Vous trouverez ci-joint les "
TexteCouleur = "consignes"
texte2 = " pour la mise en route de l'alarme du chantier :"
'---------------------------------------------------
Set xOutApp = CreateObject("Outlook.Application")
Set xMailOut = xOutApp.CreateItem(olMailItem)
With xMailOut
.Display
.To = Destinataire
.Subject = Sujet
.HTMLBody = "<FONT SIZE = 4 font face=Arial>" & Titre & ", <br>" & _
"<FONT SIZE = 3.5 font face=Arial>" & Texte1 & _
"<FONT SIZE = 5.5 font face=Arial color=blue><b>" &
TexteCouleur & "</b></br> " & _
"<FONT SIZE = 3.5 font face=Arial color=Black>" & texte2 & ""
.Send
End With
Set xMailOut = Nothing
Set xOutApp = Nothing
Application.ScreenUpdating = True
End Sub
'-----------------------------------------------------------
MichD