Sub Envoi_Mail2()
Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim curfile As String
curfile = Sheets("MailEnvoyés").Range("I13")
With Sheets("MailEnvoyés")
CCMail = .Range("F9") 'adresse mail du destinataire
' BCCMail = .Range("B3") 'copie a!!!autres destinataires
SUJBCC = .Range("F4") 'sujet du mail
End With
Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(olMailItem)
Sheets("MailEnvoyés").Activate
ActiveSheet.Range("A1:H54").Select 'Selection du tableau
ActiveWorkbook.EnvelopeVisible = True
With ActiveSheet.MailEnvelope
.Item.To = CCMail 'adresse mail destinataire
.Item.Subject = SUJBCC 'sujet du mail""
.Item.Attachments.Add curfile
End With
MsgBox "Merci de vérifier que le message apparait dans -messages envoyés- dans votre messagerie OUTLOOK."
Set olMail = Nothing
Set olApp = Nothing
Sheets("MailEnvoyés").Range("I13").Value = ""
Sheets("mailEnvoyés").CommandButton2.Visible = True
Sheets("MailEnvoyés").CommandButton4.Visible = False
End Sub