Bonjour à tous,
Je souhaiterais mettre plusieurs adresse mail dans ce code, pourriez vous svp m'apporter une solution
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 Private Sub Report_Activate() Dim fichier As String Dim base As Database: Dim requete As String Dim client_msg As New Outlook.Application Dim message As Outlook.MailItem Dim adresse As String: Dim ligne As Recordset fichier = Application.CurrentProject.Path & "\archives_factures\preparation_" & num_com.Value & ".pdf" DoCmd.OutputTo acOutputReport, , acFormatPDF, fichier, False Set base = Application.CurrentDb requete = "UPDATE Commandes SET facture_com ='facture_" & num_com.Value & ".pdf' WHERE num_com=" & num_com.Value base.Execute requete adresse = ("toto@hotmail.com") 'ligne.Close base.Close Set base = Nothing MsgBox adresse If (adresse <> "") Then If (MsgBox("Joindre la facture par courrier électronique", vbYesNo) = 6) Then Set message = client_msg.CreateItem(olMailItem) With message .Recipients.Add adresse .Subject = "Votre bon de préparation" .Body = "Cher partenaire, veuillez trouver votre bon de préparation en pièce jointe" .Attachments.Add fichier .Send End With End If End If End Sub
Partager