Link to home
Start Free TrialLog in
Avatar of TPBPIT
TPBPIT

asked on

VBA code to set Sensitvity Tag to Private based on a certain recipient in the recipient lines in Outlook

I am trying to figure out if there is a way when one of my users creates an email to a certain email group, say Friends, that the new email message will automatically set the Sensitivity Tag to Private and display a message that it was set and not allow it to be changed?  Or another possible approach would be that when the user tries to send the email with that group in one of the recipient lines it will check to see if Sensitivity Tag is set to Private and if not, it would pop up a message telling them to set it and not let the user send the email until that tag is set.  The message would continuously pop up when the user tries to send until the tag is set.

I would imagine this can be done, but I haven't coded VBA in a long time and never for Outlook.
ASKER CERTIFIED SOLUTION
Avatar of Alexei Kuznetsov
Alexei Kuznetsov
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TPBPIT
TPBPIT

ASKER

Is there a way to OR the recip.address to allow for a couple of recipients to be check?  Say I wanted to look for Friends and Enemies.

And if you do Recip.Name instead, and you wanted to use group names from the global address list, who would you enter the name?  Just as it reads in the GAL?
Yes, sure. Like this in line 4:
If Recip.Name = "Friends" Or Recip.Name = "Enemies" Then

Open in new window

Avatar of TPBPIT

ASKER

Thanks for the help with this.  It worked perfectly.