Preskoči na glavno vsebino

Kako odstraniti vse priloge iz e-pošte v Outlooku?

Običajno pri predogledu e-pošte lahko prilogo izbrišete z desnim klikom in izberete Odstranite priponko element. Včasih je v e-poštnem sporočilu veliko prilog in jih bo dolgočasno odstranjevati eno za drugo. Tukaj vam uredimo dva preprosta trika, kako odstranite vse priloge v enem e-poštnem sporočilu in odstranite vse priloge iz več e-poštnih sporočil tudi v Outlooku.

V programu Outlook ročno odstranite vse priloge v enem e-poštnem sporočilu
Odstranite vse priloge iz več e-poštnih sporočil v Outlooku s kodo VBA
Z Kutools za Outlook enostavno odstranite vse priloge iz enega ali več e-poštnih sporočil


V programu Outlook ročno odstranite vse priloge v enem e-poštnem sporočilu

Z izbirnim e-poštnim sporočilom lahko enostavno odstranite vse priloge v Odstranite priloge funkcija v Outlooku.

1. korak: Izberite e-poštno sporočilo, katerega priloge boste kasneje odstranili.

2. korak: V podoknu za branje kliknite eno od prilog, da aktivirate orodja za priloge.

Korak 3: Kliknite na Izberi vse gumb v izbor skupina na Priponke tab.

Ta korak vam bo omogočil, da hkrati izberete vse priloge v teh izbranih e-poštnih sporočilih.

Korak 4: Kliknite na Odstranite priponko gumb v Proces skupina na Priponke tab.

5. korak: V opozorilnem pogovornem oknu kliknite Odstranite priloge gumb.

Nato se vse priloge v tem izbranem e-poštnem sporočilu čim prej izbrišejo.

Opombe: Funkcija Odstrani priloge dobro deluje v programu Outlook 2010 in novejših različicah, v programu Outlook 2007 pa ne.


Enostavno odstranite vse priloge iz več izbranih e-poštnih sporočil v Outlooku:

Z Odstranite vse priloge uporabnost Kutools za Excel, lahko enostavno odstranite vse priloge iz več izbranih e-poštnih sporočil, kot je prikazano spodaj. (Priloge bodo shranjene v določeno mapo) Prenesite in poskusite zdaj! (30-dnevna brezplačna pot)


Odstranite vse priloge iz več e-poštnih sporočil v Outlooku s kodo VBA

Če želite odstraniti vse priloge iz več e-poštnih sporočil v programu Microsoft Outlook, vam bo to pomagalo z lahkoto. Priporočamo vam omogoči vse makre v Microsoft Outlooku najprej.

1. korak: Pojdite v mapo Moj dokument, ustvarite novo mapo in jo poimenujte kot Priključki OLA

2. korak: Izberite več e-poštnih sporočil, katerih priloge boste kasneje odstranili.

Opomba: Izberete lahko neprekinjena e-poštna sporočila z držanjem Ctrl tipko in klik.

Izberete lahko zaporedna e-poštna sporočila z držanjem Shift tipko in klik.

3. korak: Odprite urejevalnik VBA s pritiskom na druga tipko in F11 istočasno.

4. korak: Razširite Project1 > Predmeti Microsoft Outlook v levi vrstici in nato dvokliknite Ta OutlookSession da ga odprete v urejevalniku. Oglejte si naslednji posnetek zaslona:

5. korak: Kopirajte in prilepite naslednjo kodo VBA v podokno za urejanje.

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. korak: Pritisnite tipko F5 za zagon te kode VBA.

Zdaj so odstranjene vse priloge iz izbranih e-poštnih sporočil, pri čemer na dnu vseh izbranih e-poštnih sporočil ostanejo hiperpovezave do vsake izbrisane priloge.


Z Kutools za Outlook enostavno odstranite vse priloge iz enega ali več e-poštnih sporočil

O Loči vse priponke pripomoček Kutools za Outlook lahko hitro odstrani vse priloge iz enega ali več izbranih e-poštnih sporočil v Outlooku. Naredite naslednje.

Kutools za Outlook : z več kot 100 priročnimi dodatki za Outlook, brezplačno poskusite brez omejitev v 60 dneh.

1. Izberite eno ali več e-poštnih sporočil s prilogami, ki jih želite odstraniti, in kliknite Kutools > Orodja za pritrditevLoči vse. Oglejte si posnetek zaslona:

2. V Ljubljani Odstrani nastavitve pogovorno okno, nastavite na naslednji način.

  • 2.1 Kliknite na Brskanje , da izberete mapo za shranjevanje vseh izbrisanih prilog.
  • 2.2 Privzeto je Odlepite prilogo (-e) v spodnjem slogu potrdite polje, izberite možnost, da shranite priloge v različne mape glede na e-poštna sporočila, kot jih potrebujete.
  • 2.3 Kliknite na OK . Oglejte si posnetek zaslona:

Opombe:
1. Če želite shraniti vse priloge v isto mapo, počistite polje Ustvarite podmape v naslednjem slogu škatla.
2. Po odstranitvi prilog ikona priloge izgine z e-pošte na poštnem seznamu. Lahko preverite Ikona priloge še vedno ostane v e-poštnih sporočilih vedno shranite.
2. Poleg odstranjevanja vseh prilog iz izbranih e-poštnih sporočil lahko priloge odstranite le pod posebnimi pogoji. Na primer, želite odstraniti samo priloge, katerih velikost je večja od 500 KB, kliknite na Dodatne možnosti , da razširite pogoje, in nato konfigurirajte, kot je prikazano na spodnji sliki zaslona.

3. Kliknite Da gumb v Loči vse pogovorno okno.

4. Nato a Kutools za Outlook Pojavi se pogovorno okno, ki vam pove, koliko prilog je izbrisanih. Kliknite OK gumb. 

Zdaj se vse priloge takoj odstranijo, v izbranih e-poštnih sporočilih pa ostanejo le hiperpovezave. Lahko kliknete hiperpovezavo, da odprete ustrezno prilogo, kot jo potrebujete.

  Če želite imeti brezplačno (60-dnevno) preskusno različico tega pripomočka, kliknite, če ga želite prenestiin nato nadaljujte z uporabo postopka v skladu z zgornjimi koraki.


Najboljša pisarniška orodja za produktivnost

Kutools za Outlook - Več kot 100 zmogljivih funkcij za nadgradnjo vašega Outlooka

🤖 AI poštni pomočnik: Takojšnja profesionalna e-poštna sporočila z umetno inteligenco – z enim klikom do genialnih odgovorov, popoln ton, večjezično znanje. Preoblikujte pošiljanje e-pošte brez napora! ...

📧 Avtomatizacija e-pošte: Odsoten (na voljo za POP in IMAP)  /  Načrtujte pošiljanje e-pošte  /  Samodejna CC/BCC po pravilih pri pošiljanju e-pošte  /  Samodejno naprej (napredna pravila)   /  Samodejno dodaj pozdrav   /  E-poštna sporočila več prejemnikov samodejno razdeli na posamezna sporočila ...

📨 Email upravljanje: Enostaven priklic e-pošte  /  Blokiraj prevarantska e-poštna sporočila glede na teme in druge  /  Izbriši podvojena e-poštna sporočila  /  napredno iskanje  /  Združite mape ...

📁 Priloge ProShrani paket  /  Batch Detach  /  Paketno stiskanje  /  Samodejno shranite   /  Samodejno loči  /  Samodejno stiskanje ...

🌟 Vmesnik Magic: 😊Več lepih in kul emojijev   /  Povečajte Outlookovo produktivnost s pogledi z zavihki  /  Minimizirajte Outlook, namesto da bi ga zaprli ...

???? Čudeži z enim klikom: Odgovori vsem z dohodnimi prilogami  /   E-poštna sporočila proti lažnemu predstavljanju  /  🕘Pokaži pošiljateljev časovni pas ...

👩🏼‍🤝‍👩🏻 Stiki in koledar: Paketno dodajanje stikov iz izbranih e-poštnih sporočil  /  Razdelite skupino stikov na posamezne skupine  /  Odstranite opomnike za rojstni dan ...

Over 100 Lastnosti Čakajte na svoje raziskovanje! Kliknite tukaj, če želite odkriti več.

 

 

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