bonjour
j'utilise le code de notre amis jb pour l'envoie d'email
est ce possible de rajouter un destinataire en copie caché
voici le code pour le moment :
Sub envoi_PJ()
ChDir ActiveWorkbook.Path
répertoireAppli = ActiveWorkbook.Path ' Penser à Outils/Références Outlook
'--- Envoi par mail
Dim olapp As Outlook.Application
Sheets("destinataires").Select
[A11].Select
Do While Not IsEmpty(ActiveCell)
MsgTo = MsgTo & ActiveCell & ";"
ActiveCell.Offset(1, 0).Select
Loop
Dim msg As MailItem
Set olapp = New Outlook.Application
Set msg = olapp.CreateItem(olMailItem)
msg.To = MsgTo
msg.Subject = [A2]
msg.Body = [A5] & Chr(13) & Chr(13) & [A8].Value & Chr(13) & Chr(13)
'-- pj
[C8].Select
Do While Not IsEmpty(ActiveCell)
nf = ActiveWorkbook.Path & "\" & ActiveCell.Value
msg.Attachments.Add Source:=nf
ActiveCell.Offset(1, 0).Select
Loop
msg.Send
End Sub
Julie
j'utilise le code de notre amis jb pour l'envoie d'email
est ce possible de rajouter un destinataire en copie caché
voici le code pour le moment :
Sub envoi_PJ()
ChDir ActiveWorkbook.Path
répertoireAppli = ActiveWorkbook.Path ' Penser à Outils/Références Outlook
'--- Envoi par mail
Dim olapp As Outlook.Application
Sheets("destinataires").Select
[A11].Select
Do While Not IsEmpty(ActiveCell)
MsgTo = MsgTo & ActiveCell & ";"
ActiveCell.Offset(1, 0).Select
Loop
Dim msg As MailItem
Set olapp = New Outlook.Application
Set msg = olapp.CreateItem(olMailItem)
msg.To = MsgTo
msg.Subject = [A2]
msg.Body = [A5] & Chr(13) & Chr(13) & [A8].Value & Chr(13) & Chr(13)
'-- pj
[C8].Select
Do While Not IsEmpty(ActiveCell)
nf = ActiveWorkbook.Path & "\" & ActiveCell.Value
msg.Attachments.Add Source:=nf
ActiveCell.Offset(1, 0).Select
Loop
msg.Send
End Sub
Julie