Vai al contenuto principale

Come rimuovere tutti gli allegati dalla posta elettronica in Outlook?

Normalmente quando si visualizza l'anteprima di un'e-mail, è possibile eliminare un allegato facendo clic con il pulsante destro del mouse e selezionare il file Rimuovi allegato articolo. A volte possono esserci molti allegati in un messaggio di posta elettronica e sarà noioso rimuoverli uno per uno. Qui ti organizziamo con due semplici trucchi per rimuovere tutti gli allegati in un'unica e-mail e rimuovere tutti gli allegati da più e-mail anche in Outlook.

Rimuovi manualmente tutti gli allegati in un messaggio di posta elettronica in Outlook
Rimuovi tutti gli allegati da più messaggi di posta elettronica in Outlook con codice VBA
Rimuovi facilmente tutti gli allegati da una o più e-mail con Kutools per Outlook


Rimuovi manualmente tutti gli allegati in un messaggio di posta elettronica in Outlook

È facile rimuovere tutti gli allegati in un messaggio di posta elettronica selezionato con l'estensione Rimuovi allegati caratteristica in Outlook.

Passaggio 1: seleziona il messaggio di posta elettronica i cui allegati verranno rimossi in seguito.

Passaggio 2: fare clic su uno degli allegati nel riquadro di lettura per attivare gli strumenti degli allegati.

Passaggio 3: fare clic su Seleziona tutto nel pulsante Selezione gruppo sul allegati scheda.

Questo passaggio ti consentirà di selezionare tutti gli allegati in questo messaggio di posta elettronica selezionato contemporaneamente.

Passaggio 4: fare clic su Rimuovi allegato nel pulsante Azioni gruppo sul allegati scheda.

Passaggio 5: nella finestra di dialogo di avviso, fare clic su Rimuovi allegati pulsante.

Quindi tutti gli allegati in questi messaggi e-mail selezionati vengono eliminati il ​​prima possibile.

Note:: La funzionalità Rimuovi allegati funziona correttamente in Outlook 2010 e nella versione successiva, ma non in Outlook 2007.


Rimuovi facilmente tutti gli allegati da più e-mail selezionate in Outlook:

Grazie alla Scollega tutti gli allegati utilità di Kutools for Excel, puoi rimuovere facilmente tutti gli allegati da più e-mail selezionate come mostrato nella demo di seguito. (Gli allegati verranno salvati in una cartella specificata) Scarica e prova ora! (percorso gratuito di 30 giorni)


Rimuovi tutti gli allegati da più messaggi di posta elettronica in Outlook con codice VBA

Se desideri rimuovere tutti gli allegati da più messaggi di posta elettronica in Microsoft Outlook, il seguente metodo ti aiuterà a farlo facilmente. Ti consigliamo abilita tutte le macro in Microsoft Outlook in primo luogo.

Passaggio 1: vai alla cartella di Il mio documento, crea una nuova cartella e chiamala OAllegati

Passaggio 2: selezionare più messaggi di posta elettronica i cui allegati verranno rimossi in seguito.

Nota: È possibile selezionare messaggi di posta elettronica incoerenti tenendo premuto il tasto Ctrl tasto e facendo clic.

È possibile selezionare messaggi di posta elettronica consecutivi tenendo premuto il tasto Shift tasto e facendo clic.

Passaggio 3: aprire l'editor VBA premendo il pulsante altro chiave e F11 chiave allo stesso tempo.

Passaggio 4: espandere il file Project1 > Oggetti di Microsoft Outlook nella barra di sinistra, quindi fare doppio clic su Questa sessione di Outlook per aprirlo nell'Editor. Vedere la seguente schermata:

Passaggio 5: copia e incolla il seguente codice VBA nel riquadro di modifica.

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

Passaggio 6: premere il tasto di F5 per eseguire questo codice VBA.

Ora tutti gli allegati dai messaggi di posta elettronica selezionati vengono rimossi, lasciando collegamenti ipertestuali a ciascun allegato eliminato nella parte inferiore di tutti i messaggi di posta elettronica selezionati.


Rimuovi facilmente tutti gli allegati da una o più e-mail con Kutools per Outlook

I Scollega tutto utilità allegati di Kutools for Outlook può rimuovere rapidamente tutti gli allegati da una o più e-mail selezionate in Outlook. Si prega di fare quanto segue.

Kutools for Outlook : con più di 100 utili componenti aggiuntivi di Outlook, libero di provare senza limitazioni in 60 giorni.

1. Selezionare uno o più messaggi di posta elettronica con gli allegati che si desidera rimuovere, quindi fare clic su Kutools > Strumenti per gli allegatiScollega tutto. Vedi screenshot:

2. Nel Scollega impostazioni finestra di dialogo, configurare come segue.

  • 2.1 Fare clic su Scopri la nostra gamma di prodotti per selezionare una cartella in cui salvare tutti gli allegati eliminati.
  • 2.2 Per impostazione predefinita, il Stacca gli allegati nello stile di seguito la casella è selezionata, scegli un'opzione per salvare gli allegati in cartelle diverse in base alle e-mail di cui hai bisogno.
  • 2.3 Fare clic su OK pulsante. Vedi screenshot:

Note:
1. Se desideri salvare tutti gli allegati nella stessa cartella, deseleziona il file Crea sottocartelle nel seguente stile scatola.
2. Dopo aver rimosso gli allegati, l'icona dell'allegato scomparirà dall'e-mail della mailing list. Puoi controllare il file L'icona dell'allegato è ancora rimasta nelle e-mail scatola per tenerlo sempre.
2. Oltre a rimuovere tutti gli allegati dalle e-mail selezionate, è possibile rimuovere gli allegati solo in base a condizioni specifiche. Ad esempio, si desidera rimuovere solo gli allegati la cui dimensione è superiore a 500 KB, fare clic su Opzioni avanzate per espandere le condizioni, quindi configurare come mostrato di seguito.

3. Fare clic sul nel pulsante Scollega tutto la finestra di dialogo.

4. Quindi a Kutools for Outlook apparirà una finestra di dialogo per dirti quanti allegati sono stati eliminati. Fare clic su OK pulsante. 

Ora tutti gli allegati vengono rimossi immediatamente con solo i collegamenti ipertestuali che rimangono nelle e-mail selezionate. Puoi fare clic sul collegamento ipertestuale per aprire l'allegato corrispondente di cui hai bisogno.

  Se desideri avere una prova gratuita (60 giorni) di questa utility, fare clic per scaricarlo, quindi andare ad applicare l'operazione secondo i passaggi precedenti.


I migliori strumenti per la produttività in ufficio

Kutools for Outlook - Oltre 100 potenti funzionalità per potenziare il tuo Outlook

🤖 Assistente di posta AI: E-mail istantanee professionali con la magia dell'intelligenza artificiale: risposte geniali con un solo clic, tono perfetto, padronanza multilingue. Trasforma l'e-mail senza sforzo! ...

???? Automazione di posta elettronica: Fuori sede (disponibile per POP e IMAP)  /  Pianifica l'invio di e-mail  /  CC/BCC automatico in base alle regole durante l'invio di e-mail  /  Inoltro automatico (regole avanzate)   /  Aggiunta automatica di saluto   /  Suddividi automaticamente le email con più destinatari in singoli messaggi ...

📨 gestione e-mail: Richiama facilmente le email  /  Blocca le email truffe per soggetto e altri  /  Elimina email duplicate  /  Ricerca avanzata  /  Consolidare cartelle ...

📁 Allegati ProSalvataggio in batch  /  Stacca batch  /  Comprimi in lotti  /  Salvataggio automatico   /  Scollegamento automatico  /  Comprimi automaticamente ...

🌟 Magia dell'interfaccia: 😊Più emoji carini e fantastici   /  Aumenta la tua produttività in Outlook con le visualizzazioni a schede  /  Riduci a icona Outlook invece di chiuderlo ...

👍 Meraviglie con un clic: Rispondi a tutti con gli allegati in arrivo  /   E-mail anti-phishing  /  🕘Mostra il fuso orario del mittente ...

👩🏼‍🤝‍👩🏻 Contatti e calendario: Aggiungi in batch contatti dalle email selezionate  /  Dividere un gruppo di contatti in singoli gruppi  /  Rimuovi promemoria compleanno ...

Al di sopra Caratteristiche 100 Attendi la tua esplorazione! Clicca qui per scoprire di più.

 

 

Comments (33)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hello,
MS recently changed the storage limits for Hotmail. Attachments are counted towards storage used.
Many users would like to remove only the attachments in bulk. Your VBA script may be the solution for these users.
Can you confirm if this script still works for Hotmail users in 2023?
Thank you in advance.
This comment was minimized by the moderator on the site
The article and the comments below are very helpful! Thanks!
This comment was minimized by the moderator on the site
 Hello, I use the VBA code, unfortunaltely all the attachements were deleted from the emails, and they were not storage in any of the folders... so i lost many attachment files. anyone knows how can i restored
This comment was minimized by the moderator on the site
The VBA code shown in solution 2 works fine, however, but my goal is to remove only attachments which are not inline the message. Being VBA ignorant I would like to ask if it is possible to modify the code in that manner it would remove only attached files, not pictures inside the email text. It would surely make my day :)

Thank you in advance
This comment was minimized by the moderator on the site
Can somebody change the code so that only for example attachments named "TermsAndConditions.pdf" are deleted
This comment was minimized by the moderator on the site
Dear Rene,
Please follow the steps in the above second method, run the below VBA code. In an opening dialog box, please enter the attachment's name with the file extension (such as test.docx), and then click the OK button to just remove it from the selected email.

Sub ReplaceAttachmentsToLink()
Dim xMail As Outlook.MailItem
Dim xAttachments As Outlook.Attachments
Dim xSelection As Outlook.Selection
Dim i, xCount As Long
Dim xFile, xFldPath, xDelFiles, xFileName As String
Dim xFlag As Boolean

xFldPath = CreateObject("shell.Application").NameSpace(5).self.Path
On Error Resume Next
Set xSelection = Outlook.ActiveExplorer.Selection
xFldPath = xFldPath & "\OLAttachments"
xFlag = False
xFileName = InputBox("Attachment name:", "Kutools for Outlook")

If StrPtr(xFileName) = 0 Then Exit Sub
If xFileName <> "" Then
For Each xMail In xSelection
Set xAttachments = xMail.Attachments
xCount = xAttachments.Count
If xCount > 0 Then
For i = xCount To 1 Step -1
xFile = xAttachments.Item(i).FileName
If xFileName = xFile Then
xFlag = True
xFile = xFldPath & "\" & xFile
xAttachments.Item(i).SaveAsFile xFile
xAttachments.Item(i).Delete
If xMail.BodyFormat <> olFormatHTML Then
xDelFiles = xDelFiles & vbCrLf & ""
Else
xDelFiles = xDelFiles & "
" & "" & xFile & ""
End If
End If
Next i
If xFlag = True Then
If xMail.BodyFormat <> olFormatHTML Then
xMail.Body = xMail.Body & vbCrLf & "The file(s) were saved to " & xDelFiles
Else
xMail.HTMLBody = xMail.HTMLBody & "
" & "The file(s) were saved to " & xDelFiles & "
"
End If
End If
xMail.Save
xDelFiles = ""
End If
Next
If xFlag = False Then
MsgBox "The Attachment does not exist!"
Else
MsgBox "The attachment has been deleted."
End If
Else
MsgBox "Please input a attachment name"
End If
Set xAttachments = Nothing
Set xMail = Nothing
Set xSelection = Nothing
End Sub
This comment was minimized by the moderator on the site
Method 1 doesn't work here, as there's only 1 option under 'Selection': Copy.
This comment was minimized by the moderator on the site
Dear Peter,
Outlook users are reporting that the Select All (attachments) feature in Outlook 2016 is missing.
This comment was minimized by the moderator on the site
The VBA Code solution was great .... worked beautifully
This comment was minimized by the moderator on the site
Compile Error Sub or Function not defined??
This comment was minimized by the moderator on the site
VBA code worked great. Many thanks!
This comment was minimized by the moderator on the site
Hi This was really helpful , but as all attachments were not saved when i tried again it gives a message "the macros in this project are disabled".....tried enabling macros in outlook but no luck, any one can help! Regards Lisa
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations