Bonjour,

Je souhaiterais trouver le moyen d'automatiser la signature en fonction de si j'envoie un mail en interne dans ma société ou en externe chez un client.
J'ai trouvé ce code qui fonctionne très bien, il regarde les destinataires et il cherche si dans l'adresse il y a "thermofisher", si oui il insère la signature interne, si non la signature externe :

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
Thermo = 0
    Dim mail As Outlook.MailItem
    Set mail = Application.ActiveInspector.CurrentItem                                       'Execute la macro sur le mail actif
    Dim recips As Outlook.recipients
    Dim recip As Outlook.recipient
    Dim pa As Outlook.PropertyAccessor
    Const PR_SMTP_ADDRESS As String = _
        "http://schemas.microsoft.com/mapi/proptag/0x39FE001E"
    Set recips = mail.recipients
    For Each recip In recips
 
        Set pa = recip.PropertyAccessor
        MSGBOX pa.GetProperty(PR_SMTP_ADDRESS)
        If pa.GetProperty(PR_SMTP_ADDRESS) Like "*thermofisher*" Then
        Thermo = Thermo + 1
        Else
        Thermo = Thermo
        End If
    Next
 
    If Thermo > 0 Then
    mail.GetInspector.CommandBars.Item("Insert").Controls("Signature").Controls("Interne").Execute   'insertion de la signature
    Else
    mail.GetInspector.CommandBars.Item("Insert").Controls("Signature").Controls(1).Execute   'insertion de la signature
    End If
Seul problème : mon code prends en compte les adresses en To, Cc et Cci.
Pouvez-vous m'aider ? Que dois-je rajouter pour quil ne regarde que les adresses en To.

Merci d'avance pour votre aide.

++