Chers amis
J'ai édité ce code pour envoyer automatiquement mon fichier aux destinateurs. Tout marche bien, mais j'ai tout le temps un message qui m'oblige à valider avant d'envoyer (voir message_outlook en attache).
Quelqu'un peut me monter comment je peux envoyer sans valider ce message?
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 Dim appOutlook Dim NewMail Dim Previousday Dim Text Dim FileAttach Dim ToAddress Dim CcAddress Dim MailSubject Previousday = Day(Date-1) & "_" & Month(Date-1) & "_" & Year(Date-1) Text = "Find in attachment, Report Day_" & (Previousday) FileAttach = "D:\Report_Day_" & (Previousday) & ".xls" ToAddress = "me@address.com" CcAddress = "you@address.com" MailSubject = "Report_Day_" & (Previousday) 'Generating and sending an e-mail: Set appOutlook = CreateObject("OUTLOOK.APPLICATION") Set NewMail = appOutlook.CreateItem(0) With NewMail '.Display .To = ToAddress .Cc = CcAddress .Subject = MailSubject .Body = Text .Attachments.Add(FileAttach) .OriginatorDeliveryReportRequested = False .ReadReceiptRequested = False .Send End With Set appOutlook = Nothing Set NewMail = Nothing
Partager