如何在Outlook中刪除郵件中的所有附件?
通常,當您預覽郵件時,可以右鍵單擊並選擇「刪除附件」選項來刪除附件。有時候一封郵件中可能會有很多附件,逐一手動刪除會非常繁瑣。這裡我們為您提供兩個簡單的方法,幫助您一次性刪除一封郵件中的所有附件,甚至還能刪除多封郵件中的所有附件。
手動刪除Outlook中一封郵件的所有附件
使用VBA代碼刪除Outlook中多封郵件的所有附件
使用Kutools for Outlook輕鬆刪除一封或多封郵件中的所有附件
手動刪除Outlook中一封郵件的所有附件
利用Outlook中的「刪除附件」功能,可以輕鬆刪除所選郵件中的所有附件。
步驟 1:選擇您稍後要刪除附件的郵件。
步驟 2:點擊閱讀窗格中的任意一個附件以啟用附件工具。
步驟 3:在「附件」選項卡的「區域 」組中,點擊「全選」按鈕。
此步驟將讓您一次性選擇該郵件中的所有附件。
步驟 4:在「附件」選項卡的「操作」組中,點擊「刪除附件」按鈕。
步驟 5:在警告對話框中,點擊「刪除附件」按鈕。
然後,這封所選郵件中的所有附件將立即被刪除。
備註:「刪除附件」功能在Outlook 2010及更高版本中運行良好,但在Outlook 2007中不適用。
輕鬆刪除Outlook中多封所選郵件的所有附件:
借助Kutools for Excel的「拆解所有附件」工具,您可以輕鬆刪除多封所選郵件中的所有附件,如下方示範所示。(附件將保存到指定文件夾)立即下載並試用!(30-天免費試用)
使用VBA代碼刪除Outlook中多封郵件的所有附件
如果您想刪除Microsoft Outlook中多封郵件的所有附件,以下方法將幫助您輕鬆完成。我們建議您首先在Microsoft Outlook中啟用所有宏。
步驟 1:進入「我的文檔」文件夾,創建一個新文件夾,並將其命名為OLAttachments。
步驟 2:選擇您稍後要刪除附件的多封郵件。
備註:您可以按住Ctrl 鍵並點擊來選擇不連續的郵件。
您可以按住Shift 鍵並點擊來選擇連續的郵件。
步驟 3:同時按下Alt鍵和F11鍵打開VBA編輯器。
步驟 4:在左側欄中展開Project1 > Microsoft Outlook Objects,然後雙擊ThisOutlookSession以在編輯器中打開它。請參見以下截圖:
步驟 5:複製並將以下VBA代碼粘貼到編輯窗格中。
Public Sub ReplaceAttachmentsToLink()
Dim objApp As Outlook.Application
Dim aMail As Outlook.MailItem 'Object
Dim oAttachments As Outlook.Attachments
Dim oSelection As Outlook.Selection
Dim i As Long
Dim iCount As Long
Dim sFile As String
Dim sFolderPath As String
Dim sDeletedFiles As String
' Get the path to your My Documents folder
sFolderPath = CreateObject("WScript.Shell").SpecialFolders(16)
On Error Resume Next
' Instantiate an Outlook Application object.
Set objApp = CreateObject("Outlook.Application")
' Get the collection of selected objects.
Set oSelection = objApp.ActiveExplorer.Selection
' Set the Attachment folder.
sFolderPath = sFolderPath & "\OLAttachments"
' Check each selected item for attachments. If attachments exist,
' save them to the Temp folder and strip them from the item.
For Each aMail In oSelection
' This code only strips attachments from mail items.
' If aMail.class=olMail Then
' Get the Attachments collection of the item.
Set oAttachments = aMail.Attachments
iCount = oAttachments.Count
If iCount > 0 Then
' We need to use a count down loop for removing items
' from a collection. Otherwise, the loop counter gets
' confused and only every other item is removed.
For i = iCount To 1 Step -1
' Save attachment before deleting from item.
' Get the file name.
sFile = oAttachments.Item(i).FileName
' Combine with the path to the Temp folder.
sFile = sFolderPath & "\" & sFile
' Save the attachment as a file.
oAttachments.Item(i).SaveAsFile sFile
' Delete the attachment.
oAttachments.Item(i).Delete
'write the save as path to a string to add to the message
'check for html and use html tags in link
If aMail.BodyFormat <> olFormatHTML Then
sDeletedFiles = sDeletedFiles & vbCrLf & "<file://" & sFile & ">"
Else
sDeletedFiles = sDeletedFiles & "<br>" & "<a href='file://" & _
sFile & "'>" & sFile & "</a>"
End If
Next i
'End If
' Adds the filename string to the message body and save it
' Check for HTML body
If aMail.BodyFormat <> olFormatHTML Then
aMail.Body = aMail.Body & vbCrLf & _
"The file(s) were saved to " & sDeletedFiles
Else
aMail.HTMLBody = aMail.HTMLBody & "<p>" & _
"The file(s) were saved to " & sDeletedFiles & "</p>"
End If
aMail.Save
'sets the attachment path to nothing before it moves on to the next message.
sDeletedFiles = ""
End If
Next 'end aMail
ExitSub:
Set oAttachments = Nothing
Set aMail = Nothing
Set oSelection = Nothing
Set objApp = Nothing
End Sub
步驟 6:按下F5鍵運行此VBA代碼。
現在,所選郵件中的所有附件都已刪除,並且在所有所選郵件的底部留下了指向每個已刪除附件的超鏈接。
使用Kutools for Outlook輕鬆刪除一封或多封郵件中的所有附件
Kutools for Outlook的「拆解所有附件」工具可以快速從Outlook中的一封或多封所選郵件中刪除所有附件。請按照以下步驟操作。
Kutools for Outlook:擁有超過100個實用的Outlook插件, 可免費試用30天無任何限制。
1. 選擇一或多封帶有您想要刪除附件的郵件,然後點擊 Kutools > 附件工具 > 拆解所有附件。請參見截圖:
2. 在「拆離設定」對話框中,請進行以下配置。
- 2.1 點擊「瀏覽」按鈕選擇一個文件夾來保存所有刪除的附件。
- 2.2 默認情況下,「按以下樣式拆離附件」框已被勾選,請根據需要選擇一種方式將附件保存到不同文件夾中。
- 2.3 點擊「確定」按鈕。請參見截圖:
3. 在「拆解所有附件」對話框中點擊「是」按鈕。
4. 然後會彈出一個Kutools for Outlook對話框,告訴您刪除了多少附件。請點擊「確定」按鈕。
現在,所有附件都立即被刪除,僅留下超鏈接在所選郵件中。您可以點擊超鏈接隨時打開相應的附件。
如果您想免費試用此工具(30天),請點擊下載,然後按照上述步驟進行操作申請。
最佳辦公室生產力工具
最新消息:Kutools for Outlook推出免費版本!
體驗全新的Kutools for Outlook免費版本,擁有70多項令人驚嘆的功能,永久使用!立即點擊下載!
🤖 Kutools AI :使用先進的AI技術輕鬆處理郵件,包括答覆、摘要、優化、擴展、翻譯和撰寫郵件。
📧 郵件自動化:自動回覆(適用於POP和IMAP) / 計劃發送郵件 / 發送郵件時按規則自動抄送密送 / 自動轉發(高級規則) / 自動新增問候語 / 自動將多收件人郵件拆分為個別郵件...
📨 郵件管理:撤回郵件 / 按主題和其他方式阻止詐騙郵件 / 刪除重複郵件 / 高級搜索 / 整合文件夾...
📁 附件專業版:批量保存 / 批量拆離 / 批量壓縮 / 自動保存 / 自動拆離 / 自動壓縮...
🌟 介面魔法:😊更多漂亮和酷炫的表情符号 / 當重要郵件到來時提醒您 / 最小化Outlook而不是關閉...
👍 一鍵奇蹟:帶附件全部答復 / 防止網絡釣魚郵件 / 🕘顯示發件人的時區...
👩🏼🤝👩🏻 聯絡人和日曆:從選中郵件批量新增聯絡人 / 將聯絡人組拆分為個別組 / 移除生日提醒...
立即單擊解鎖Kutools for Outlook。不要等待,立即下載並提升您的效率!

