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
|
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
'By Oliv' 29/06/2007 pour Outlook 2003
Dim myRecipient As Outlook.Recipient
If Not Item.Class = olMail Then GoTo fin
Dim prompt As String
' ici renseigner le destinataire
cci = "toto@tata.fr"
'commentez au choix l'option non voulue
'########################Option CCI############################
prompt = "Ajouter le cci suivant : " & cci & "?"
Dim reponse
reponse = MsgBox(prompt, vbYesNoCancel + vbQuestion, "Copie cachée")
If reponse = vbCancel Then
Cancel = True
Exit Sub
ElseIf reponse = vbYes Then
Set myRecipient = Item.Recipients.Add(cci)
myRecipient.Type = olBCC
myRecipient.Resolve
If myRecipient.Resolved = False Then
MsgBox "L'adresse Email n'est pas correcte !", vbCritical, "Erreur"
Cancel = True
End If
End If
fin:
End Sub |
Partager