Bonjour,

j'ai besoin de votre aide, car j'ai un message d'erreur lors de l'affichage de mon e-mail. Sur mon formulaire, je double click sur l'adresse e-mail et je souhaite qu'un nouvel email s'ouvre avec l'adresse e-mail qu'il y a sur mon formulaire. l'email s'ouvre bien avec l'adresse e-mail, mais j'ai ce message.

Nom : Capture.JPG
Affichages : 98
Taille : 48,3 Ko

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
 
Private Sub Emailprive_DblClick(Cancel As Integer)
 
 '   Call OpenOutlook
    Call CreateEmail(Me.Emailprive, Me.Nom, Me.Prénom)
 
 
End Sub
J'ai trouvé ce code sur votre FAQ. j'ai juste ajouté la fonction oEmail.Display



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
42
43
44
45
46
47
48
49
50
51
 
Public Sub CreateEmail( _
    Recipient As String, _
    Subject As String, _
    Body As String, _
    Optional Attach As Variant)
 ' --------------------------
    Dim I As Integer
    Dim oEmail As Outlook.MailItem
    Dim appOutLook As Outlook.Application
 
    ' Créer un nouvel item mail
 
    Set appOutLook = New Outlook.Application
    Set oEmail = appOutLook.CreateItem(olMailItem)
 
    ' Les paramètres
 
    oEmail.To = Recipient
    oEmail.Subject = Subject
    oEmail.Body = Body
    oEmail.Display
 
 
    If Not IsMissing(Attach) Then
 
       If TypeName(Attach) = "String" Then
 
             ' S'il y a des pièces jointes
            oEmail.Attachments.Add Attach
 
        Else
 
            For I = 0 To UBound(Attach) - 1
            oEmail.Attachments.Add Attach(I)
 
            Next
 
        End If
 
    End If
 
    ' Envoie le message
 '   oEmail.Send
 
    ' Détruit les références aux objets
    Set oEmail = Nothing
 
    Set appOutLook = Nothing
 
End Sub
Est-ce que quelqu'un pourrait m'aider ?