I need a custom Outlook Rule, programmed with VBA
Posted on 2009-04-22
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. firstname.lastname@example.org, email@example.com, and firstname.lastname@example.org.
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, email@example.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 firstname.lastname@example.org, 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 do 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?
So basically what I'm asking for is VBA code -- unless someone can think of another alternative.
I have Outlook 2000 by the way, but could upgrade if absolutely necssary...