• Outlook User
  • New Outlook app
  • Outlook.com
  • Outlook Mac
  • Outlook & iCloud
  • Developer
  • Microsoft 365 Admin
    • Common Problems
    • Microsoft 365
    • Outlook BCM
    • Utilities & Addins

Move messages CC'd to an address

Slipstick Systems

› Developer › Move messages CC’d to an address

Last reviewed on August 29, 2018     8 Comments

A security update disabled the Run a script option in the rules wizard in Outlook 2010 and all newer Outlook versions. See Run-a-Script Rules Missing in Outlook for more information and the registry key to fix restore it.

When you create a rule in Outlook, you can look for messages sent To or CC'd to an address but you can't look only at the CC field. If you want to create a rule to act on mail only by an address in the CC field, you need to use VBA.

The scripts on this page moves messages CC'd to an Exchange DL to a subfolder of the Inbox. Run a script rules (well, any rules) are fine for light-duty work, but when they need to process a lot of mail at once, some messages may be skipped. In those cases, using an ItemAdd event may be better, but even so, under really heavy loads, some messages may still be skipped.

Use a run a script rule to move mail cc'd to someoneThe first sample uses in a Run a Script rule. To use it, 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 in the To or CC field. The script will check the CC field for an address or alias and if found, do something. In this example, the message is moved to a subfolder of the Inbox.

The second sample does not use Rules Wizard, instead it runs when Outlook starts and moves mail meeting the condition. It checks every message to see if the CC matches the name you entered.

These rules can be edited to move messages based on other conditions.

Use a Run a Script rule

To use, create a rule with the run a script action, choosing this 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.CC = "dl or alias name" Then
      objMail.Move Session.GetDefaultFolder(olFolderInbox).Folders("subfolder-name")
   End If

Set objMail = Nothing

End Sub

Move the messages using an ItemAdd Event

To use this script, place it at the top of ThisOutlookSession and click in the Application_Startup macro then press Run to enable it without restarting Outlook.

Option Explicit

Private WithEvents olInboxItems As Items

Private Sub Application_Startup()
  Dim objNS As NameSpace
  Set objNS = Application.Session
  ' instantiate objects declared WithEvents
  Set olInboxItems = objNS.GetDefaultFolder(olFolderInbox).Items
  Set objNS = Nothing
End Sub

Private Sub olInboxItems_ItemAdd(ByVal Item As Object)
  On Error Resume Next
  Dim strID As String
    Dim objMail As Outlook.MailItem
    
    strID = Item.EntryID
    Set objMail = Application.Session.GetItemFromID(strID)

   If objMail.CC = "alias" Then
      objMail.Move Session.GetDefaultFolder(olFolderInbox).Folders("folder-name")
   End If

Set objMail = Nothing

End Sub

More Information

More Run a Script Samples:

  • Autoaccept a Meeting Request using Rules
  • Automatically Add a Category to Accepted Meetings
  • Blocking Mail From New Top-Level Domains
  • Convert RTF Messages to Plain Text Format
  • Create a rule to delete mail after a number of days
  • Create a Task from an Email using a Rule
  • Create an Outlook Appointment from a Message
  • Create Appointment From Email Automatically
  • Delegates, Meeting Requests, and Rules
  • Delete attachments from messages
  • Forward meeting details to another address
  • How to Change the Font used for Outlook's RSS Feeds
  • How to Process Mail After Business Hours
  • Keep Canceled Meetings on Outlook's Calendar
  • Macro to Print Outlook email attachments as they arrive
  • Move messages CC'd to an address
  • Open All Hyperlinks in an Outlook Email Message
  • Outlook AutoReplies: One Script, Many Responses
  • Outlook's Rules and Alerts: Run a Script
  • Process messages received on a day of the week
  • Read Outlook Messages using Plain Text
  • Receive a Reminder When a Message Doesn't Arrive?
  • Run a script rule: Autoreply using a template
  • Run a script rule: Reply to a message
  • Run a Script Rule: Send a New Message when a Message Arrives
  • Run Rules Now using a Macro
  • Run-a-Script Rules Missing in Outlook
  • Save all incoming messages to the hard drive
  • Save and Rename Outlook Email Attachments
  • Save Attachments to the Hard Drive
  • Save Outlook Email as a PDF
  • Sort messages by Sender domain
  • Talking Reminders
  • To create a rule with wildcards
  • Use a Macro to Copy Data in an Email to Excel
  • Use a Rule to delete older messages as new ones arrive
  • Use a run a script rule to mark messages read
  • Use VBA to move messages with attachments
Move messages CC'd to an address was last modified: August 29th, 2018 by Diane Poremsky

Related Posts:

  • A simple run a rule script marks Outlook messages read when the messag
    Use a run a script rule to mark messages read
  • Delegates, Meeting Requests, and Rules
  • Use VBA to move messages with attachments
  • Send a New Message when a Message Arrives

About Diane Poremsky

A Microsoft Outlook Most Valuable Professional (MVP) since 1999, Diane is the author of several books, including Outlook 2013 Absolute Beginners Book. She also created video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.

Subscribe
Notify of
8 Comments
newest
oldest most voted
Inline Feedbacks
View all comments

Bunny (@guest_219613)
August 9, 2022 3:03 am
#219613

Hi,
Can someone please help me with the step by step guide for this.. I am new to this and non technical person. Please help
Thanks

0
0
Reply
Tad Schlatre (@guest_212873)
March 4, 2019 9:19 am
#212873

Hi Diane,

INSTEAD of moving an email CC'd to a DL to a different folder, what VBA command would I need to use in place of objMail.Move to simply mark the email as "Read" but leave it in my Inbox?

Tad

0
0
Reply
Diane Poremsky(@diane-poremsky)
Author
Reply to  Tad Schlatre
March 6, 2019 8:20 pm
#212886

objmail.unread = false

0
0
Reply
Thomas (@guest_208519)
September 6, 2017 7:58 am
#208519

OK found it ;-)
To move to any folder at the root of my email account, I replaced

objMail.Move Session.GetDefaultFolder(olFolderInbox).Folders("subfolder-name")

by

Set ns = Application.GetNamespace("MAPI")
objMail.Move ns.Folders("FirstName.LASTNAME@domain.com").Folders("subfolder-name")

of course, replace "FirstName.LASTNAME@domain.com" by the name of your account. Could also be "Mailbox - FirstName LastName" for example

0
0
Reply
Thomas (@guest_208517)
September 6, 2017 7:47 am
#208517

Thanks Diane, this worked like a charm in my Outlook 2013.
I used your suggestion "If InStr(LCase(objMail.CC), "address") Then" instead. One comment maybe, make sure to type the name of the sysgroup in lower case. Also in my case it only worked if I entered the resolved name and not the full email address. So basically if Outlook displays "SysGroup-Name" in the CC field, enter "sysgroup-name" and not "sysgroup-name@domain.com"

0
0
Reply
Stephen (@guest_178753)
August 15, 2013 9:43 am
#178753

Thank you so much for your quick response! I got it moving to the correct folder now but seems to be moving a lot others as well but will try and work that out...

Thank you again!

Steve

0
0
Reply
cmsgraham (@guest_176079)
April 23, 2013 11:19 am
#176079

In my case the first script is working when the dl or alias name is the only mail in the cc. If there are more addresses in the cc does not works. Tks

1
-1
Reply
Diane Poremsky (@guest_176094)
Reply to  cmsgraham
April 23, 2013 8:51 pm
#176094

Use something like this instead:
If InStr(LCase(objMail.CC), "address") Then

1
-1
Reply

Visit Slipstick Forums.
What's New at Slipstick.com

Latest EMO: Vol. 30 Issue 16

Subscribe to Exchange Messaging Outlook






Support Services

Do you need help setting up Outlook, moving your email to a new computer, migrating or configuring Office 365, or just need some one-on-one assistance?

Our Sponsors

CompanionLink
ReliefJet
  • Popular
  • Latest
  • Week Month All
  • Use Classic Outlook, not New Outlook
  • How to Remove the Primary Account from Outlook
  • Disable "Always ask before opening" Dialog
  • Adjusting Outlook's Zoom Setting in Email
  • This operation has been cancelled due to restrictions
  • How to Hide or Delete Outlook's Default Folders
  • Reset the New Outlook Profile
  • Save Attachments to the Hard Drive
  • Add Attachments and Set Email Fields During a Mail Merge
  • Outlook SecureTemp Files Folder
  • Open Outlook Templates using PowerShell
  • Count and List Folders in Classic Outlook
  • Google Workspace and Outlook with POP Mail
  • Import EML Files into New Outlook
  • Opening PST files in New Outlook
  • New Outlook: Show To, CC, BCC in Replies
  • Insert Word Document into Email using VBA
  • Delete Empty Folders using PowerShell
  • Warn Before Deleting a Contact
  • Classic Outlook is NOT Going Away in 2026
Ajax spinner

Recent Bugs List

Microsoft keeps a running list of issues affecting recently released updates at Fixes or workarounds for recent issues in classic Outlook (Windows).

For new Outlook for Windows: Fixes or workarounds for recent issues in new Outlook for Windows .

Outlook for Mac Recent issues: Fixes or workarounds for recent issues in Outlook for Mac

Outlook.com Recent issues: Fixes or workarounds for recent issues on Outlook.com

Office Update History

Update history for supported Office versions is at Update history for Office

Outlook Suggestions and Feedback

Outlook Feedback covers Outlook as an email client, including Outlook Android, iOS, Mac, and Windows clients, as well as the browser extension (PWA) and Outlook on the web.

Outlook (new) Feedback. Use this for feedback and suggestions for Outlook (new).

Use Outlook.com Feedback for suggestions or feedback about Outlook.com accounts.

Other Microsoft 365 applications and services




New Outlook Articles

Open Outlook Templates using PowerShell

Count and List Folders in Classic Outlook

Google Workspace and Outlook with POP Mail

Import EML Files into New Outlook

Opening PST files in New Outlook

New Outlook: Show To, CC, BCC in Replies

Insert Word Document into Email using VBA

Delete Empty Folders using PowerShell

Warn Before Deleting a Contact

Classic Outlook is NOT Going Away in 2026

Newest Code Samples

Open Outlook Templates using PowerShell

Count and List Folders in Classic Outlook

Insert Word Document into Email using VBA

Warn Before Deleting a Contact

Use PowerShell to Delete Attachments

Remove RE:, FWD:, and Other Prefixes from Subject Line

Change the Mailing Address Using PowerShell

Categorize @Mentioned Messages

Send an Email When You Open Outlook

Delete Old Calendar Events using VBA

VBA Basics

How to use the VBA Editor

Work with open item or selected item

Working with All Items in a Folder or Selected Items

VBA and non-default Outlook Folders

Backup and save your Outlook VBA macros

Get text using Left, Right, Mid, Len, InStr

Using Arrays in Outlook macros

Use RegEx to extract message text

Paste clipboard contents

Windows Folder Picker

Custom Forms

Designing Microsoft Outlook Forms

Set a custom form as default

Developer Resources

Developer Resources

Developer Tools

VBOffice.net samples

SlovakTech.com

Outlook MVP David Lee

Repair PST

Convert an OST to PST

Repair damaged PST file

Repair large PST File

Remove password from PST

Merge Two Data Files

Sync & Share Outlook Data

  • Share Calendar & Contacts
  • Synchronize two computers
  • Sync Calendar and Contacts Using Outlook.com
  • Sync Outlook & Android Devices
  • Sync Google Calendar with Outlook
  • Access Folders in Other Users Mailboxes

Diane Poremsky [Outlook MVP]

Make a donation

Mail Tools

Sending and Retrieval Tools

Mass Mail Tools

Compose Tools

Duplicate Remover Tools

Mail Tools for Outlook

Online Services

Calendar Tools

Schedule Management

Calendar Printing Tools

Calendar Reminder Tools

Calendar Dates & Data

Time and Billing Tools

Meeting Productivity Tools

Duplicate Remover Tools

Productivity

Productivity Tools

Automatic Message Processing Tools

Special Function Automatic Processing Tools

Housekeeping and Message Management

Task Tools

Project and Business Management Tools

Choosing the Folder to Save a Sent Message In

Run Rules on messages after reading

Help & Suggestions

Submit Outlook Feature Requests

Slipstick Support Services

Buy Microsoft 365 Office Software and Services

Visit Slipstick Forums.

What's New at Slipstick.com

Home | Outlook User | Exchange Administrator | Office 365 | Outlook.com | Outlook Developer
Outlook for Mac | Common Problems | Utilities & Addins | Tutorials
Outlook & iCloud Issues | Outlook Apps
EMO Archives | About Slipstick | Slipstick Forums
Submit New or Updated Outlook and Exchange Server Utilities

Send comments using our Feedback page
Copyright © 2025 Slipstick Systems. All rights reserved.
Slipstick Systems is not affiliated with Microsoft Corporation.

wpDiscuz

Sign up for Exchange Messaging Outlook

Our weekly Outlook & Exchange newsletter (bi-weekly during the summer)






Please note: If you subscribed to Exchange Messaging Outlook before August 2019, please re-subscribe.

Never see this message again.

You are going to send email to

Move Comment