---
description: If you’re accustomed to removing the attachments of emails after you sending them out, you can use the method introduced in this article, which is using Outlook VBA to help you auto get it.
title: How to Auto Remove the Attachments of an Email after Sending It in Outlook
image: https://www.datanumen.com/blogs/wp-content/uploads/2017/04/auto-remove-the-attachments-of-an-email-after-sending-it.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 Auto Remove the Attachments of an Email after Sending It in Outlook

# How to Auto Remove the Attachments of an Email after Sending It in Outlook

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

Share Now:

-
-
-
-
-
-
-
-

*If you’re accustomed to removing the attachments of emails after you sending them out, you can use the method introduced in this article, which is using Outlook VBA to help you auto get it.*

As the attachments of the outgoing emails are usually stored in your own PC, you may be used to deleting the attachments after you send out the emails. This will keep your PST file in small size, which can not only ensure good performance of your Outlook but also reduce the odds of PST corruption. Therefore, if you would like to let Outlook automatically delete the attachments of outgoing emails, you can use the following method, which is applying VBA codes.

![Auto Remove the Attachments of an Email after Sending It](https://www.datanumen.com/blogs/wp-content/uploads/2017/04/auto-remove-the-attachments-of-an-email-after-sending-it.jpg "Auto Remove the Attachments of an Email after Sending It")

## Auto Remove the Attachments of an Email after Sending It

1. At the very outset, launch your Outlook application.
2. Then press “Alt + F11” key shortcuts.
3. Next you will get into the Outlook VBA editor.
4. Subsequently, you should open the “ThisOutlookSession” project window.
5. Then copy and paste the following VBA codes into it.

```
Public WithEvents objSentMails As Outlook.Items

Private Sub Application_Startup()
    Set objSentMails = Outlook.Application.Session.GetDefaultFolder(olFolderSentMail).Items
End Sub

Private Sub objSentMails_ItemAdd(ByVal Item As Object)
    Dim objSentMail As Outlook.MailItem
    Dim objAttachments As Outlook.attachments
    Dim i As Long
    Dim strAttachmentInfo As String
 
    'Only work on emails
    If Item.Class = olMail Then
       Set objSentMail = Item
    End If
 
    Set objAttachments = objSentMail.attachments
 
    While objAttachments.Count > 0
          'Get the information of removed attachments
          strAttachmentInfo = "<HTML><BODY>Attachment Removed: " & objAttachments.Item(1).DisplayName & "</HTML></BODY>---------------------------------------------------------" & strAttachmentInfo
          objAttachments.Item(1).Delete
    Wend
 
    'Insert the information of removed attachments to the body
    objSentMail.HTMLBody = strAttachmentInfo & objSentMail.HTMLBody
    objSentMail.Save
End Sub
```

![VBA Codes - Auto Remove the Attachments of an Email after Sending It](<> "VBA Codes - Auto Remove the Attachments of an Email after Sending It")

6. After that, you ought to sign this code.

- Firstly, use Digital Certificates for VBA Projects to create a certificate.
- Then assign this certificate to the new macro. Click “Tools” > “Signature” and then just follow the onscreen instructions.

7. Later you can back to main Outlook window and hit “Macro Security” under “Developer” tab.
8. Next in the popup dialog box, change macro settings to permit the digitally signed macros.
9. Finally restart your Outlook to activate the new VBA project.
10. From now on, every time when you send an email out, its attachments will be deleted automatically, like the following screenshot:![Attachments Get Removed after Sending](<> "Attachments Get Removed after Sending")

## Resolve Outlook Issues in Time

It is an unquestioned fact that Outlook is error prone. Therefore, if you would like to protect your Outlook data from loss or corruption, you have to spend a lot of efforts, including making regular data backups and keeping a robust [Outlook fix](https://www.datanumen.com/outlook-repair/) tool in vicinity, such as DataNumen Outlook Repair.

## Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including [corrupt mdf](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/4-smart-ways-create-landscape-table-word-document/)

[Next post →](https://www.datanumen.com/blogs/4-useful-ways-indent-paragraphs-left-right-word-document/)

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\/auto-remove-attachments-email-sending-outlook\/#article","isPartOf":{"@id":"https:\/\/www.datanumen.com\/blogs\/auto-remove-attachments-email-sending-outlook\/"},"author":{"name":"AuthorCCW","@id":"https:\/\/www.datanumen.com\/blogs\/#\/schema\/person\/33ded6c47c77587f9158d99f05e23957"},"headline":"How to Auto Remove the Attachments of an Email after Sending It in Outlook","datePublished":"2017-04-12T00:57:19+00:00","dateModified":"2025-09-29T10:52:19+00:00","mainEntityOfPage":{"@id":"https:\/\/www.datanumen.com\/blogs\/auto-remove-attachments-email-sending-outlook\/"},"wordCount":372,"commentCount":0,"publisher":{"@id":"https:\/\/www.datanumen.com\/blogs\/#organization"},"image":{"@id":"https:\/\/www.datanumen.com\/blogs\/auto-remove-attachments-email-sending-outlook\/#primaryimage"},"thumbnailUrl":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2017\/04\/auto-remove-the-attachments-of-an-email-after-sending-it.jpg","articleSection":["Outlook Solutions"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.datanumen.com\/blogs\/auto-remove-attachments-email-sending-outlook\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.datanumen.com\/blogs\/auto-remove-attachments-email-sending-outlook\/","url":"https:\/\/www.datanumen.com\/blogs\/auto-remove-attachments-email-sending-outlook\/","name":"How to Auto Remove the Attachments of an Email after Sending It in Outlook","isPartOf":{"@id":"https:\/\/www.datanumen.com\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.datanumen.com\/blogs\/auto-remove-attachments-email-sending-outlook\/#primaryimage"},"image":{"@id":"https:\/\/www.datanumen.com\/blogs\/auto-remove-attachments-email-sending-outlook\/#primaryimage"},"thumbnailUrl":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2017\/04\/auto-remove-the-attachments-of-an-email-after-sending-it.jpg","datePublished":"2017-04-12T00:57:19+00:00","dateModified":"2025-09-29T10:52:19+00:00","description":"If you’re accustomed to removing the attachments of emails after you sending them out, you can use the method introduced in this article, which is using Outlook VBA to help you auto get it.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.datanumen.com\/blogs\/auto-remove-attachments-email-sending-outlook\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.datanumen.com\/blogs\/auto-remove-attachments-email-sending-outlook\/#primaryimage","url":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2017\/04\/auto-remove-the-attachments-of-an-email-after-sending-it.jpg","contentUrl":"https:\/\/www.datanumen.com\/blogs\/wp-content\/uploads\/2017\/04\/auto-remove-the-attachments-of-an-email-after-sending-it.jpg","width":539,"height":369,"caption":"Auto Remove the Attachments of an Email after Sending It"},{"@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\/"]}]}
```
