Skip to main content

How to block emails with zip (files) attachments in Outlook?

Author: Kelly Last Modified: 2017-07-25

In Outlook daily work, you may receive hundreds of spams with .zip attachments. Here, this tutorial will introduce a solution to block all emails with .zip attachments in Outlook.

Block emails with zip (files) attachments in Outlook

Office Tab - Enable Tabbed Editing and Browsing in Microsoft Office, Making Work a Breeze
Unlock Kutools for Outlook's free version now and enjoy over 70 features with unlimited access forever
Boost your Outlook 2021 - 2010 or Outlook 365 with these advanced features. Enjoy 70+ powerful features and elevate your email experience!

arrow blue right bubbleBlock emails with zip (files) attachments in Outlook

This method will introduce a VBA, and then create a rule with this VBA script to block all emails with .zip attachments in Outlook automatically. Please do as follows:

1. In Outlook, press Alt + F11 keys together to open the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and then paste below VBA code into the new Module window.

VBA: Move emails with .zip attachments to Junk E-mail folder

Dim I As Long
'Check each attachment
For I = 1 To Item.Attachments.Count
'If the attachment's file name ends with .zip
If Right(UCase(Item.Attachments.Item(I).FileName), 4) = ".ZIP" Then
'Move the message to Junk E-mail
Item.Move Application.Session.GetDefaultFolder(olFolderJunk)
'No need to check any of this message's remaining attachments
Exit For
End If
Next I
End Sub

3. Save the VBA code, and close the Microsoft Visual Basic for Applications window.

4. Now you return to the Outlook main interface. Select any email in the specified email account, and click Home > Rules > Manage Rules & Alerts. See screenshot:

5. In the Rules and Alerts dialog box, please click the New Rule under E-mail Rules tab. See screenshot:

6. Now the Rules Wizard opens. Please click the Apply rule on messages I receive option and click the Next button. See screenshot:

7. In the Rules Wizard (Select condition(s)), please check which has an attachment option, and click the Next button. See screenshot:

8. In the Rules Wizard (Select action(s)), please do as following screenshot shown:
(1) Check the run a script option;
(2) Click the text of a script in the Step 2 section;
(3) In the Select Script dialog box select the new added VBA script, and click OK button;
(4) Click the Next button.

9. Click Next button in the Rules Wizard (select exceptions) directly.

10. Now in the last Rules Wizard, please (1) name the new rule in the Step 1 box, (2) specify options as you need in the Step 2 section, and then (3) click the Finish button. See screenshot:

11. Close the Rules and Alerts dialog box.

So far, you have finished the rule with the specified VBA script. And all incoming emails with .zip attachments will be moved to the Junk E-mail folder automatically.


arrow blue right bubbleRelated Articles


Best Office Productivity Tools

Breaking News: Kutools for Outlook Launches Free Version!

Experience the all-new Kutools for Outlook FREE version with 70+ incredible features, yours to use FOREVER! Click to download now!

πŸ€– Kutools AI : Instant pro emails with AI magic--one-click to genius replies, perfect tone, multilingual mastery. Transform emailing effortlessly! ...

πŸ“§ Email Automation: Auto Reply (Available for POP and IMAP)  /  Schedule Send Emails  /  Auto CC/BCC by Rules When Sending Email  /  Auto Forward (Advanced Rules)   /  Auto Add Greeting   /  Automatically Split Multi-Recipient Emails into Individual Messages ...

πŸ“¨ Email Management: Recall Emails  /  Block Scam Emails by Subjects and Others  /  Delete Duplicate Emails  /  Advanced Search  /  Consolidate Folders ...

πŸ“ Attachments ProBatch Save  /  Batch Detach  /  Batch Compress  /  Auto Save   /  Auto Detach  /  Auto Compress ...

🌟 Interface Magic: 😊More Pretty and Cool Emojis   /  Remind you when important emails come  /  Minimize Outlook Instead of Closing ...

πŸ‘ One-click Wonders: Reply All with Incoming Attachments  /   Anti-Phishing Emails  /  πŸ•˜Show Sender's Time Zone ...

πŸ‘©πŸΌβ€πŸ€β€πŸ‘©πŸ» Contacts & Calendar: Batch Add Contacts From Selected Emails  /  Split a Contact Group to Individual Groups  /  Remove Birthday Reminders ...

Instantly unlock Kutools for Outlook with a single clickβ€”permanently free. Don't wait, download now and boost your efficiency!

kutools for outlook features1 kutools for outlook features2
 

 

 

Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Leave your comments
Posting as Guest
Rate this post:
0   Characters
Suggested Locations