Search code examples
outlookoutlook-addinemail-validation

Providing feedback based on the names or emails addresses in the 'To:', 'CC:' and 'BCC:' text fields while composing an Outlook email message


When composing an outlook message, I would like to provide non-invasive feedback to the user regarding whether the email is being sent to email addresses on approved domains.

For example, if the user is sending an email where the 'To:', 'CC:' or 'BCC:' text fields contains an email address which does not end in '@AnEmailAddress.com' then a warning of some kind should be displayed appropriately.

The warning could be a single icon which shows red or green, or perhaps each name/email address can be formatted on the 'To:' et al text fields directly, in order to provide the feedback.

I've done some digging with no specific results. I'm not sure if this can be done with VBA or the scripting within Outlook forms. Or perhaps an add-in needs to be written via .net?

Any pointers greatly appreciated.


Solution

  • This is a good candidate for .NET add-in. Not sure if you can do that from VBA. Depending on the range of Outlook versions you need to support, you may want to go for VSTO add-in (separate builds for different versions) or NetOffice (one build for nearly all versions). Both have pros and cons so you need to be more specific to make a choice.