MailItem_PropertyChange event is firing three times when recipient is changed

147 Views Asked by At

I am trying to automatically fill the salutation in my mails depending on the recipient.

To start this routine I use the event MailItem_PropertyChange which is gives back the name of the changed property.

At any change of the "To" field the event handler fires three times.
The first time it gives back the name "To".
The second time it gives back the name "CC".
The third time it gives back the name "BCC".

This means, no matter which one of the three values I change, my routine always acts as if I changed the To value.

Private Sub objMail_PropertyChange(ByVal Name As String)
    If Name = "To" Then
        objMail.htmlBody = "Hallo Zusammen" & objMail.htmlBody
    End If
End Sub
1

There are 1 best solutions below

4
Dmitry Streblechenko On

Yes, because 3 properties (potentially) change.

enter image description here