6

There is already a similar question, but it doesn't work for me because I'm not a direct recipient (I'm member of a group).

I'm trying to set up a new rule for incoming messages. Suppose we have

# GroupA
# GroupB

and a message arrives

TO: # GroupA
CC: # GroupB

I have a rule set up, which is saying:

Apply this rule after the message arrives
where sent to # GroupB
move it to the ToGroupB folder

But this detects # GroupB as a recipient, so it moves the message to the ToGroupB folder, which is not what I want. Can I have a rule which works only based on TO field?

1
+50

Outlook built-in rules cannot distinguish between To and CC. You will need a VBA script for that.

To use such a script, create a rule with the condition "Sent to people or group", entering the address you want to filter on. This rule will apply only to mail where the address is in the To or CC field. The script will check the To field for an address or alias and only if found move the message to a subfolder of the Inbox.

Create a rule with the Run a script action, choosing a similar script to the following (untested) script:

Sub MoveMail(Item As Outlook.MailItem)
    Dim strID As String
    Dim objMail As Outlook.MailItem

    strID = Item.EntryID
    Set objMail = Application.Session.GetItemFromID(strID)

   If objMail.To = "GroupA" Then
      objMail.Move Session.GetDefaultFolder(olFolderInbox).Folders("subfolder-name")
   End If

Set objMail = Nothing

End Sub

Source : Move messages CC'd to an address.

Note that the MailItem.To Property returns a semicolon-delimited String list of display names for the To recipients. If there are more than one recipient, some more VBA is required.

| improve this answer | |
1

Unfortunately you can't without using VBA macro (that runs for each message and mimics the rule) or server-side trickery (like setting custom category / property / flag for required messages).

| improve this answer | |
  • Hmm. Do you any examples of such a macro? – DavidPostill Sep 6 '16 at 17:15
  • Something like this: slipstick.com/developer/move-messages-cc-address (this checks CC only, but you can easily modify it for To). – thims Sep 6 '16 at 17:17
  • Thanks. I added the bonus for another user. I will ask him to check this out. – DavidPostill Sep 6 '16 at 17:18
  • The rule that you are trying will only move emails from specified people or group to a local folder. What you are actually looking for is to forward any email from Group A to Group B. – Scorpion99 Sep 8 '16 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.