Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programming custom rules in Outlook VBA

Status
Not open for further replies.

sweetcow

Technical User
Oct 20, 2008
28
US
I have an interesting email problem.

First, I'm really sorry for the length of this question! But it's a totally riveting read I swear…

So I'm managing the email for an office of 3 people. Previously each person just had their own email address, and things were very simple. jon@bleh.com, judy@bleh.com, and james@bleh.com.

But now there's a new requirement whereby all emails must be captured by a 3rd party's server. The typical way to do this is to have all emails in and out be to and from the new email address opened with that 3rd party, newemail@thirdparty.com.

But doing this would be a major inconvenience. Changing all our business cards, informing all our clients, and most importantly losing our personal identities -- I don't particularly want to merge all 3 emails into one.

So I've been thinking of ways to keep our current emails, but still have them pass through and be captured by the third party's server.

For emailing out this is surprisingly easy. I changed the SMTP server info of the 3 old emails to the third parties's SMTP server. Now sending emails from those address sends them through that server, and so is captured by it, but still feels and looks just like it's coming from the same old address. Brilliant!

But for emails coming in I'm having some difficulties. I set up email forwarding on my server, so that all emails addressed to the 3 old addresses are now forwarded to the new one. So all incoming emails are now captured. Good.

But my problem is now that everyone is now receiving everyone's emails, of course. Jon is receiving all of Judy and James' emails, as well as his own, and they are receiving his and each others'.

I was thinking I'd remedy this with Outlook's Rules. The original recipient information IS retained even though it is passed through the third party email. So an email to Judy@bleh.com, then forwarded to newemail@thirdparty.com, then downloaded into Outlook, STILL has Judy@bleh.com listed as the recipient. That's good and I been taking advantage of that by creating rules in each user's Outlook that says -- in Jon's Outlook, for example -- if Judy or James is listed as the recipient then delete the downloaded message.

But there's TWO issues with this:

1.If an email is addressed to multiple users, both Jon and Judy, for example, that rule will still delete it even though JON should be entitled to see it. So really what I need is a rule that says, if Jon is NOT included then delete. But this option isn't included in the list of rules in Outlook! So, any thoughts on how to get around this? I was thinking I could program a new rule in VBA, but don't know how to go about this.

2.It's not really ideal to be downloading emails for EVERYONE and THEN deleting them, because they're still retained in the Deleted Items folder, and people can still read other people's emails. A superior solution would of course be to apply the rules as they are being downloaded, and only download those that pass the test. Is there a way to do this with the VBA code?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top