Mise en forme d'un mail en HTML

Résolu
alias666 Messages postés 308 Date d'inscription mardi 1 juin 2004 Statut Membre Dernière intervention 23 mars 2010 - 24 oct. 2008 à 10:56
jmfmarques Messages postés 7666 Date d'inscription samedi 5 novembre 2005 Statut Membre Dernière intervention 22 août 2014 - 24 oct. 2008 à 11:28
Bonjour à tous,


Actuellement je cherche à pouvoir mettre en forme un mail au format
HTML, bizarrement je n'arrive à le faire malgré plusieurs essai et une
recherche sur le net qui retrace ce que j'ai fais en gros dans mon code.


Pouvez vous m'éclaircir svp ?

<hr size= "2" width="100%" />
 
PrivateSub btnConfirmationRV_Click()
Dim olApp As Outlook.Application
Dim objNewMail As Outlook.MailItem
Dim var AsVariant
Dim ObjAdoClient As ADODB.Recordset
Dim Sql AsString
Dim Adresse AsString

 

Set olApp = New Outlook.Application
Set objNewMail = olApp.CreateItem(olMailItem)
Call FrmSAV.vaSpread1.GetText(1, vaSpread1.ActiveRow, var)
Sql "SELECT MainAddress1 FROM T_Customer WHERE ClientName'" & var & "'"
Set ObjAdoClient = ObjAdoMain.Execute(Sql)
WhileNot ObjAdoClient.EOF
Adresse = ObjAdoClient!MainAddress1
ObjAdoClient.MoveNext
Wend
ObjAdoClient.Close
objNewMail.BodyFormat = olFormatHTML
objNewMail.Subject = "Confirmation de Rendez-vous"
objNewMail.body = "<html><head>CONFIRMATION DE RENDEZ-VOUS
</head>" & vbCrLf & " " & vbCrLf & " " & vbCrLf & "" & _
" Client : " & var & vbCrLf & _
"" & vbCrLf & _
"Contact : " & vbCrLf & vbCrLf & vbCrLf & _
"Date(s) Intervention(s) : " & vbCrLf & _
"Heure(s) Intervention(s) : " & vbCrLf & vbCrLf & vbCrLf & _
"Chargé(e) de planification : " & FrmPpl.StatusBar1.Panels(2) & vbCrLf & vbCrLf & _
"Commentaires :" & vbCrLf & _
"Si F.I. type - Installation initiale : " & vbCrLf & vbCrLf & _
"Si F.I. type - Autres : " & vbCrLf & vbCrLf & _
"Adresse d'intervention : " & Adresse & _
"" & FrmFicheSAV.Text1(2).Text & vbCrLf & vbCrLf & _
"Cordialement," & vbCrLf & vbCrLf & _
FrmPpl.StatusBar1.Panels(2).Text & "</head></html>"
objNewMail.display
'objNewMail.send
EndSub
 

<hr size ="2" width="100%" />
Merci par avance !

_______________________
<<<< :-: 4L!@$ :-: >>>>

3 réponses

alias666 Messages postés 308 Date d'inscription mardi 1 juin 2004 Statut Membre Dernière intervention 23 mars 2010
24 oct. 2008 à 11:26
Ok j'ai compris mon erreur !

Pour ceux qui veulent :

Remplacer :
objNewMail.body

Par

objNewMail.HTMLbody

_______________________
<<<< :-: 4L!@$ :-: >>>>
3
jmfmarques Messages postés 7666 Date d'inscription samedi 5 novembre 2005 Statut Membre Dernière intervention 22 août 2014 27
24 oct. 2008 à 11:27
Bonjour,
Essaye de remplacer body par htmlbody dans
objNewMail.body
0
jmfmarques Messages postés 7666 Date d'inscription samedi 5 novembre 2005 Statut Membre Dernière intervention 22 août 2014 27
24 oct. 2008 à 11:28
Ah ... croisés ...
0
Rejoignez-nous