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 ?

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
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 
Private Sub btnConfirmationRV_Click()
    Dim olApp As Outlook.Application
    Dim objNewMail As Outlook.MailItem
    Dim var As Variant
    Dim ObjAdoClient As ADODB.Recordset
    Dim Sql As String
    Dim Adresse As String
 
 
 
    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)
    While Not ObjAdoClient.EOF
        Adresse = ObjAdoClient!MainAddress1
        ObjAdoClient.MoveNext
    Wend
    ObjAdoClient.Close
    objNewMail.BodyFormat = olFormatHTML
    objNewMail.Subject = "Confirmation de Rendez-vous"
    objNewMail.body = "<html><head><H3>CONFIRMATION DE RENDEZ-VOUS</H3></head>" & vbCrLf & " " & vbCrLf & " " & vbCrLf & "" & _
    "<body><b>Client :</b> " & 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
End Sub
Merci par avance