---
description: If you want to create a rule to block the senders of multiple selected emails, usually, you have to first write down the senders and then create a rule manually. It is quite troublesome. Thus, here we will share a much quicker method to get it via one click.
title: How to Quickly Create an Outlook Rule to Block the Senders of Multiple Emails
image: https://www.datanumen.com/blogs/wp-content/uploads/2018/05/vba-code-create-rule-block-multiple-senders.jpg
---

-
-
-

[Home](https://www.datanumen.com/blogs/) > [Solutions](https://www.datanumen.com/blogs/category/solutions/) > [Office Solutions](https://www.datanumen.com/blogs/category/solutions/office-solutions/) > [Outlook Solutions](https://www.datanumen.com/blogs/category/solutions/office-solutions/outlook-solutions/) > How to Quickly Create an Outlook Rule to Block the Senders of Multiple Emails

# How to Quickly Create an Outlook Rule to Block the Senders of Multiple Emails

[Outlook Solutions](https://www.datanumen.com/blogs/category/solutions/office-solutions/outlook-solutions/) September 29, 2025

Share Now:

-
-
-
-
-
-
-
-

*If you want to create a rule to block the senders of multiple selected emails, usually, you have to first write down the senders and then create a rule manually. It is quite troublesome. Thus, here we will share a much quicker method to get it via one click.*

Some users think the inbuilt “ant-spam” feature in Outlook is not as effective as they hope. Therefore, they are accustomed to creating Outlook rules to block the senders. Now, in the followings, we will introduce a quick method to create a rule to block the senders of multiple emails.

## Quickly Create a Rule to Block Senders of Multiple Emails

1. For a start, launch Outlook application.
2. Then, enter VBA editor window via the shortcut “Alt + F11”.
3. Next, in the new window, put the following VBA code into an unused module.

```
Sub CreateRuleForBlockingMultipleSenders()
    Dim objRules As Outlook.Rules
    Dim objRule As Outlook.Rule
    Dim objMoveRuleAction As Outlook.MoveOrCopyRuleAction
    Dim objFromCondition As Outlook.ToOrFromRuleCondition
    Dim objSelection As Outlook.Selection
    Dim objMail As Outlook.MailItem
    Dim objJunkFolder As Outlook.Folder
 
    Set objRules = Application.Session.DefaultStore.GetRules()
    'Create a rule
    Set objRule = objRules.Create("Block Senders", olRuleReceive)
    Set objFromCondition = objRule.Conditions.From
 
    'Get the selected emails
    Set objSelection = Outlook.Application.ActiveExplorer.Selection
    'Get Junk Email folder
    Set objJunkFolder = Outlook.Application.Session.GetDefaultFolder(olFolderJunk)
 
    For i = objSelection.Count To 1 Step -1
        If objSelection.Item(i).Class = olMail Then
 
           Set objMail = objSelection.Item(i)
 
           'Add the email senders to rule condition
           With objFromCondition
                .Enabled = True
                .Recipients.Add objMail.SenderEmailAddress
                .Recipients.ResolveAll
           End With
 
           'Move the emails from blocked senders to Junk Email folder
           Set objMoveRuleAction = objRule.Actions.MoveToFolder
           With objMoveRuleAction
                .Enabled = True
                .Folder = objJunkFolder
           End With
         End If
    Next
 
    objRules.Save
End Sub
```

![VBA Code - Quickly Create a Rule to Block the Senders of Multiple Emails]( "VBA Code - Quickly Create a Rule to Block the Senders of Multiple Emails")

4. After that, in accordance to “ [How to Run VBA Code in Your Outlook](https://www.datanumen.com/blogs/run-vba-code-outlook/)“, add this macro to Quick Access Toolbar or ribbon.
5. Subsequently, exit the VBA editor normally.
6. Lastly, take the following steps to have a try.

- First of all, select the emails whose senders you want to block.
- Then, click the new macro button.![Run Macro on Selected Emails]( "Run Macro on Selected Emails")
- After macro finishes, you can go to “File” menu and click “Manage Rules and Alerts” button to check the newly added rule, as shown in the image below.![New Rule]( "New Rule")

## Keep Malicious Emails at Bay

No matter what email client you use, you must frequently receive the emails from unknown senders. Most of the emails may be advertising spams and even contain malicious macros. They can damage your Outlook file in a jiffy. Thus, in Outlook, you ought to take effective measures to block the unknown emails. In addition, if you can afford it, it is advisable to prepare a powerful PST recovery tool, such as DataNumen Outlook Repair. It can [repair Outlook](https://www.datanumen.com/outlook-repair/) file without breaking a sweat no matter how seriously it’s damaged.

## Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including [sql recovery](https://www.datanumen.com/sql-recovery/) and outlook repair software products. For more information visit [www.datanumen.com](https://www.datanumen.com/)

Share Now:

-
-
-
-
-
-
-
-

[← Previous post](https://www.datanumen.com/blogs/how-to-auto-forward-specific-incoming-emails-with-custom-subject-body-in-outlook/)

[Next post →](https://www.datanumen.com/blogs/how-to-batch-change-the-reminder-time-of-multiple-appointments-with-outlook-vba/)

Comments are closed.

![Data Recovery Blog]()

Follow or like us on Facebook, LinkedIn and Twitter to get all promotions, latest news and updates on our products and company.

-
-
-

### Featured Products

- [DataNumen Outlook Repair](https://www.datanumen.com/outlook-repair/)
- [DataNumen SQL Recovery](https://www.datanumen.com/sql-recovery/)
- [DataNumen Exchange Recovery](https://www.datanumen.com/exchange-recovery/)
- [DataNumen Access Repair](https://www.datanumen.com/access-repair/)
- [DataNumen Excel Repair](https://www.datanumen.com/excel-repair/)
- [DataNumen PDF Repair](https://www.datanumen.com/pdf-repair/)
- [DataNumen Word Repair](https://www.datanumen.com/word-repair/)
- [DataNumen Zip Repair](https://www.datanumen.com/zip-repair/)

### Popular posts

```json
{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.datanumen.com\/blogs\/how-to-quickly-create-an-outlook-rule-to-block-the-senders-of-multiple-emails\/#article","isPartOf":{"@id":"https:\/\/www.datanumen.com\/blogs\/how-to-quickly-create-an-outlook-rule-to-block-the-senders-of-multiple-emails\/"},"author":{"name":"AuthorCCW","@id":"https:\/\/www.datanumen.com\/blogs\/#\/schema\/person\/33ded6c47c77587f9158d99f05e23957"},"headline":"How to Quickly Create an Outlook Rule to Block the Senders of Multiple Emails","datePublished":"2018-05-16T05:27:18+00:00","dateModified":"2025-09-29T05:54:37+00:00","mainEntityOfPage":{"@id":"https:\/\/www.datanumen.com\/blogs\/how-to-quickly-create-an-outlook-rule-to-block-the-senders-of-multiple-emails\/"},"wordCount":366,"commentCount":1,"publisher":{"@id":"https:\/\/www.datanumen.com\/blogs\/#organization"},"image":{"@id":"https:\/\/www.datanumen.com\/blogs\/how-to-quickly-create-an-outlook-rule-to-block-the-senders-of-multiple-emails\/#primaryimage"},"thumbnailUrl":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2018\/05\/vba-code-create-rule-block-multiple-senders.jpg","articleSection":["Outlook Solutions"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.datanumen.com\/blogs\/how-to-quickly-create-an-outlook-rule-to-block-the-senders-of-multiple-emails\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.datanumen.com\/blogs\/how-to-quickly-create-an-outlook-rule-to-block-the-senders-of-multiple-emails\/","url":"https:\/\/www.datanumen.com\/blogs\/how-to-quickly-create-an-outlook-rule-to-block-the-senders-of-multiple-emails\/","name":"How to Quickly Create an Outlook Rule to Block the Senders of Multiple Emails","isPartOf":{"@id":"https:\/\/www.datanumen.com\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.datanumen.com\/blogs\/how-to-quickly-create-an-outlook-rule-to-block-the-senders-of-multiple-emails\/#primaryimage"},"image":{"@id":"https:\/\/www.datanumen.com\/blogs\/how-to-quickly-create-an-outlook-rule-to-block-the-senders-of-multiple-emails\/#primaryimage"},"thumbnailUrl":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2018\/05\/vba-code-create-rule-block-multiple-senders.jpg","datePublished":"2018-05-16T05:27:18+00:00","dateModified":"2025-09-29T05:54:37+00:00","description":"If you want to create a rule to block the senders of multiple selected emails, usually, you have to first write down the senders and then create a rule manually. It is quite troublesome. Thus, here we will share a much quicker method to get it via one click.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.datanumen.com\/blogs\/how-to-quickly-create-an-outlook-rule-to-block-the-senders-of-multiple-emails\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanumen.com\/blogs\/how-to-quickly-create-an-outlook-rule-to-block-the-senders-of-multiple-emails\/#primaryimage","url":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2018\/05\/vba-code-create-rule-block-multiple-senders.jpg","contentUrl":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2018\/05\/vba-code-create-rule-block-multiple-senders.jpg","width":894,"height":371,"caption":"VBA Code - Quickly Create a Rule to Block the Senders of Multiple Emails"},{"@type":"WebSite","@id":"https:\/\/www.datanumen.com\/blogs\/#website","url":"https:\/\/www.datanumen.com\/blogs\/","name":"Data Recovery Blog","description":"Discuss every aspect of data recovery","publisher":{"@id":"https:\/\/www.datanumen.com\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.datanumen.com\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.datanumen.com\/blogs\/#organization","name":"Data Recovery Blog","url":"https:\/\/www.datanumen.com\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanumen.com\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2019\/02\/logowithouttext.jpg","contentUrl":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2019\/02\/logowithouttext.jpg","width":296,"height":397,"caption":"Data Recovery Blog"},"image":{"@id":"https:\/\/www.datanumen.com\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataNumen","https:\/\/x.com\/DataNumen","http:\/\/www.linkedin.com\/company\/datanumen","https:\/\/myspace.com\/datanumen\/","http:\/\/www.pinterest.com\/datanumen\/","https:\/\/www.youtube.com\/channel\/UCVIIuuKfUBHSJauUaVP13tw"]},{"@type":"Person","@id":"https:\/\/www.datanumen.com\/blogs\/#\/schema\/person\/33ded6c47c77587f9158d99f05e23957","name":"AuthorCCW","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3516ed90fc242780d3947a989f895bc46e70c3e83485d30f2b457a007906aa58?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3516ed90fc242780d3947a989f895bc46e70c3e83485d30f2b457a007906aa58?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3516ed90fc242780d3947a989f895bc46e70c3e83485d30f2b457a007906aa58?s=96&d=mm&r=g","caption":"AuthorCCW"},"sameAs":["https:\/\/www.datanumen.com\/"]}]}
```
