1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Sub copiepj()
Dim newmail As MailItem
Dim curitem As MailItem
Dim chemin As String
chemin = "c:\temp\"
Set curitem = Application.ActiveInspector.CurrentItem
Set newmail = curitem.Reply
newmail.To = ""
newmail.Body = "Fait, pour vérification" & vbCrLf & curitem.Body
newmail.CC = "mondest1"
For i = 1 To curitem.Attachments.Count
curitem.Attachments(i).SaveAsFile chemin & curitem.Attachments(i).DisplayName
newmail.Attachments.Add chemin & curitem.Attachments(i).DisplayName
Next i
'Pièces jointes ajout du 2eme dest et phrase clé
If curitem.Attachments.Count > 0 Then
newmail.CC = newmail.CC & ";" & "mondest2"
newmail.Body = vbCrLf & "Pour classement" & vbCrLf & newmail.Body
End If
newmail.Save
End Sub |
Partager