Outlook 2010 rule based only on TO field (ignore CC field)

6

1

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?

Ondrej

Posted 2014-09-02T08:24:11.953

Reputation: 163

Answers

1

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.

harrymc

Posted 2014-09-02T08:24:11.953

Reputation: 306 093

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).

thims

Posted 2014-09-02T08:24:11.953

Reputation: 8 081

Hmm. Do you any examples of such a macro? – DavidPostill – 2016-09-06T17:15:40.507

Something like this: http://www.slipstick.com/developer/move-messages-cc-address/ (this checks CC only, but you can easily modify it for To).

– thims – 2016-09-06T17:17:28.353

Thanks. I added the bonus for another user. I will ask him to check this out. – DavidPostill – 2016-09-06T17:18:31.933

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 – 2016-09-08T11:07:23.543