Note: The other languages of the website are Google-translated. Back to English
Mewngofnodi  \/ 
x
or
x
Cofrestru  \/ 
x

or

Sut i gael gwared ar yr holl atodiadau o e-bost yn Outlook?

Fel rheol pan fyddwch yn rhagolwg e-bost, gallwch ddileu atodiad gyda chlicio ar y dde a dewis y Dileu Ymlyniad eitem. Weithiau gall fod llawer o atodiadau mewn neges e-bost, a bydd yn ddiflas eu tynnu fesul un. Yma rydym yn eich trefnu gyda dau dric hawdd i gael gwared ar yr holl atodiadau mewn un e-bost, a thynnu pob atodiad o sawl e-bost hefyd yn Outlook.

Tynnwch yr holl atodiadau â llaw mewn un neges e-bost yn Outlook
Tynnwch yr holl atodiadau o negeseuon e-bost lluosog yn Outlook gyda chod VBA
Tynnwch yr holl atodiadau yn hawdd o un neu sawl e-bost gyda Kutools ar gyfer Outlook


Tynnwch yr holl atodiadau â llaw mewn un neges e-bost yn Outlook

Mae'n hawdd cael gwared ar yr holl atodiadau mewn negeseuon e-bost dethol gyda'r Dileu Atodiadau nodwedd yn Outlook.

Cam 1: Dewiswch y neges e-bost y byddwch chi'n tynnu ei atodiadau yn nes ymlaen.

Cam 2: Cliciwch un o atodiadau yn y Pane Darllen i actifadu'r Offer Atodiadau.

Cam 3: Cliciwch y Dewis Popeth botwm yn y Dewis grŵp ar y Ymlyniadau tab.

Bydd y cam hwn yn eich galluogi i ddewis yr holl atodiadau yn y negeseuon e-bost dethol hyn ar unwaith.

Cam 4: Cliciwch y Dileu Ymlyniad botwm yn y Camau Gweithredu grŵp ar y Ymlyniadau tab.

Cam 5: Yn y blwch deialog rhybuddio, cliciwch y Dileu Atodiadau botwm.

Yna caiff yr holl atodiadau yn y negeseuon e-bost dethol hyn eu dileu cyn gynted â phosibl.

Nodyn: Mae'r nodwedd Dileu Atodiadau yn gweithio'n iawn yn Outlook 2010 a'r fersiwn ddiweddarach, ond nid yn Outlook 2007.


Tynnwch yr holl atodiadau yn hawdd o sawl e-bost a ddewiswyd yn Outlook:

Efo'r Datgysylltwch Pob atodiad cyfleustodau Kutools ar gyfer Excel, gallwch chi gael gwared ar yr holl atodiadau yn hawdd o sawl e-bost a ddewiswyd fel y demo isod a ddangosir. (Bydd yr atodiadau yn cael eu cadw mewn ffolder benodol) Dadlwythwch a cheisiwch nawr! (Llwybr am ddim 30 diwrnod)


Tynnwch yr holl atodiadau o negeseuon e-bost lluosog yn Outlook gyda chod VBA

Os ydych chi am dynnu pob atodiad o nifer o negeseuon e-bost yn Microsoft Outlook, bydd y dull canlynol yn eich helpu i'w wneud yn hawdd. Rydym yn eich argymell galluogi pob macros yn eich Microsoft Outlook yn gyntaf.

Cam 1: Ewch i ffolder Fy Nogfen, creu ffolder newydd, a'i enwi fel OLAttachments

Cam 2: Dewiswch nifer o negeseuon e-bost y byddwch chi'n tynnu eu hatodiadau yn nes ymlaen.

Nodyn: Gallwch ddewis negeseuon e-bost anghynhenid ​​gyda dal y Ctrl allwedd a chlicio.

Gallwch ddewis negeseuon e-bost yn olynol gyda dal y Symud allwedd a chlicio.

Cam 3: Agorwch y Golygydd VBA gyda phwyso'r Alt allwedd a F11 allwedd ar yr un pryd.

Cam 4: Ehangu'r Project1 > Gwrthrychau Microsoft Outlook yn y bar chwith, ac yna cliciwch ddwywaith ar y ThisOutlookSession i'w agor yn y Golygydd. Gweler y llun sgrin canlynol:

Cam 5: Copïwch a gludwch y cod VBA canlynol yn y cwarel golygu.

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

Cam 6: Pwyswch allwedd F5 i redeg y cod VBA hwn.

Nawr mae'r holl atodiadau o negeseuon e-bost dethol yn cael eu tynnu, gyda hypergysylltiadau gadael i bob atodiad wedi'i ddileu ar waelod yr holl negeseuon e-bost a ddewiswyd.


Tynnwch yr holl atodiadau yn hawdd o un neu sawl e-bost gyda Kutools ar gyfer Outlook

Mae'r Datgysylltwch Bawb atodiadau cyfleustodau o Kutools ar gyfer Rhagolwg yn gallu tynnu pob atodiad yn gyflym o un neu sawl e-bost dethol yn Outlook. Gwnewch fel a ganlyn.

Kutools ar gyfer Rhagolwg : gyda mwy na 100 o ychwanegion Outlook defnyddiol, am ddim i geisio heb unrhyw gyfyngiad mewn 60 diwrnod.

1. Dewiswch un neu fwy o negeseuon e-bost gyda'r atodiadau rydych chi am eu tynnu, yna cliciwch Kutools > Offer YmlyniadDatgysylltwch Bawb. Gweler y screenshot:

2. Yn y Gosodiadau Datgysylltu blwch deialog, ffurfweddwch fel a ganlyn.

  • 2.1 Cliciwch y Pori botwm i ddewis ffolder i arbed yr holl atodiadau sydd wedi'u dileu.
  • 2.2 Yn ddiofyn, mae'r Datgysylltwch atodiad (au) yn yr arddull islaw blwch yn cael ei wirio, dewiswch opsiwn i gadw'r atodiadau i wahanol ffolderau yn seiliedig ar e-byst yn ôl yr angen.
  • 2.3 Cliciwch y OK botwm. Gweler y screenshot:

Nodiadau:
1. Os ydych chi am arbed pob atodiad i'r un ffolder, dad-diciwch y Creu is-ffolderi yn yr arddull ganlynol blwch.
2. Ar ôl tynnu atodiadau, bydd eicon yr atodiad yn diflannu o e-bost y rhestr bostio. Gallwch wirio'r Mae'r eicon ymlyniad yn dal i fod yn yr e-byst blwch i'w gadw bob amser.
2. Ar wahân i dynnu pob atodiad o e-byst dethol, gallwch dynnu atodiadau yn ôl amodau penodol yn unig. Er enghraifft, dim ond tynnu'r atodiadau y mae'r maint yn fwy na 500KB yr ydych am eu tynnu, cliciwch y Dewisiadau mwy cymhleth botwm i ehangu'r amodau, ac yna ffurfweddu fel y sgriw isod.

3. Cliciwch ar y Ydw botwm yn y Datgysylltwch Bawb blwch deialog.

4. Yna a Kutools ar gyfer Rhagolwg bydd blwch deialog yn ymddangos i ddweud wrthych faint o atodiadau sy'n cael eu dileu. Cliciwch y OK botwm. 

Nawr mae'r holl atodiadau'n cael eu tynnu ar unwaith gyda dim ond y hypergysylltiadau yn gadael mewn e-byst dethol. Gallwch glicio ar yr hyperddolen i agor yr atodiad cyfatebol yn ôl yr angen.

  Os ydych chi am gael treial am ddim (60 diwrnod) o'r cyfleustodau hwn, cliciwch i'w lawrlwytho, ac yna ewch i gymhwyso'r llawdriniaeth yn ôl y camau uchod.


Kutools for Outlook - Yn Dod â 100 o Nodweddion Uwch i'w Rhagweld, a Gwneud Gwaith yn Haws Osgach!

  • Auto CC / BCC yn ôl rheolau wrth anfon e-bost; Auto Ymlaen E-byst Lluosog yn ôl arfer; Ymateb Auto heb weinydd cyfnewid, a nodweddion mwy awtomatig ...
  • Rhybudd BCC - dangoswch neges pan geisiwch ateb popeth os yw'ch cyfeiriad post yn rhestr BCC; Atgoffwch Wrth Ymlyniadau ar Goll, a mwy o nodweddion atgoffa ...
  • Ymateb (Pawb) Gyda'r Holl Atodiadau yn y sgwrs bost; Ateb Llawer o E-byst mewn eiliadau; Auto Ychwanegu Cyfarchiad wrth ateb; Ychwanegu Dyddiad i'r pwnc ...
  • Offer Ymlyniad: Rheoli Pob Atodiad ym mhob Post, Datgysylltiad Auto, Cywasgu Pawb, Ail-enwi Pawb, Arbed Pawb ... Adroddiad Cyflym, Cyfrif Postiau Dethol...
  • E-byst Sothach Pwerus yn ôl arfer; Tynnwch y Post a Chysylltiadau Dyblyg... Yn eich galluogi i wneud yn ddoethach, yn gyflymach ac yn well yn Outlook.
tab kutools rhagweld kutools tab 1180x121
kutools rhagweld rhagolygon kutools ynghyd â thab 1180x121
 
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    mirog59@gmail.com · 1 years ago
    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
  • To post as a guest, your comment is unpublished.
    René · 3 years ago
    Can somebody change the code so that only for example attachments named "TermsAndConditions.pdf" are deleted
    • To post as a guest, your comment is unpublished.
      crystal · 3 years ago
      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
  • To post as a guest, your comment is unpublished.
    Peter · 3 years ago
    Method 1 doesn't work here, as there's only 1 option under 'Selection': Copy.
    • To post as a guest, your comment is unpublished.
      crystal · 3 years ago
      Dear Peter,
      Outlook users are reporting that the Select All (attachments) feature in Outlook 2016 is missing.
  • To post as a guest, your comment is unpublished.
    Dinesh · 4 years ago
    The VBA Code solution was great .... worked beautifully
  • To post as a guest, your comment is unpublished.
    Ray · 4 years ago
    Compile Error Sub or Function not defined??
  • To post as a guest, your comment is unpublished.
    Ciaran · 4 years ago
    VBA code worked great. Many thanks!
  • To post as a guest, your comment is unpublished.
    Lisa · 4 years ago
    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
  • To post as a guest, your comment is unpublished.
    John · 4 years ago
    This code was exactly what I was looking for. If you want to take it a step further .. Use the "More Commands" , Choose commands from drop down and choose "Macros"... you will see this macro and "Add>>"... Now you have a button at the very top. Custom select emails with attachments and click new macro button at top. Thank you again for posting this code!!!!! :-)
  • To post as a guest, your comment is unpublished.
    Mike · 5 years ago
    The code works beautifully. Just one thing I noticed, the code doesn't register attachments in certain types of emails such as invites or undeliverable emails. So if these emails are in a line of selected emails, the code will stop when it reaches one of these emails. You have to delete these attachments manually (or the entire email), then run the code again. Not sure if there is any way to alter the code so it takes these types of emails into account. Otherwise, this has been extremely helpful.
  • To post as a guest, your comment is unpublished.
    Gordon · 5 years ago
    I have use KU to remove attachments on multiple emails (about 100 so far), but it had not reduced the file size of my mailbox. Can you explain why this might be?
  • To post as a guest, your comment is unpublished.
    Dejan · 5 years ago
    How to change folder path to let's say, D instead of My Documents?
  • To post as a guest, your comment is unpublished.
    David South · 5 years ago
    Works for individual outlook messages but for multiple messages the attachments overwrote each other where the attachments were named the same.
  • To post as a guest, your comment is unpublished.
    Melody Scott · 5 years ago
    Great, thanks, exactly what I was looking for!
  • To post as a guest, your comment is unpublished.
    Wayne · 5 years ago
    Terrific tips! Thanks!
    • To post as a guest, your comment is unpublished.
      chasoe · 5 years ago
      Thx so much. In fact, I've been using the vba codes as shown in "Remove all attachments from multiple email messages in Outlook with VBA code', and the codes work fine.

      My point is I cannot modify the codes to convert the hyperlink to plain text. There is no use showing the hyperlink, as the linked folder/files will be deleted sooner or later as the volume increase to a certain size.

      Looking forward to your further advice.

      Best regards
      • To post as a guest, your comment is unpublished.
        sadfs · 1 years ago
        delete the bottom section from the macro

        If aMail.BodyFormat <> olFormatHTML Then
        sDeletedFiles = sDeletedFiles & vbCrLf & "
  • To post as a guest, your comment is unpublished.
    Edward Chan · 5 years ago
    I find the VBA very good, but is it possible to convert the hyperlink to pure text, as it seems too many hyperlinks in the Outlook .pst file will eat up memory.

    In fact I only wish to retain the attachment file names, as relevant files have been saved (if necessary) already when the mail is read.

    Would anyone help ?
    Thx a lot.
  • To post as a guest, your comment is unpublished.
    Stuart · 5 years ago
    Code works fab,

    Is it possible to change the location that the attachments are saved? I use several different PCs at work, and having the attachments save onto the C:/.

    Can I save to network drive if I know the path?
  • To post as a guest, your comment is unpublished.
    omoyer · 6 years ago
    This code only removes attachments from the selected mail item. I am using 2013 if that is an issue
  • To post as a guest, your comment is unpublished.
    Cam Banks · 6 years ago
    This works partially; some attachments are removed, but many are not. Running Outlook 2013, 15.0.4701.1000. I would hesitate to purchase KU Tools if this can't be resolved first.
  • To post as a guest, your comment is unpublished.
    JW · 6 years ago
    well done. this is what I needed, many thanks
  • To post as a guest, your comment is unpublished.
    Sally · 6 years ago
    The attachments done appear to be detaching, I can still open the emails and the pdfs, any ideas? thanks.
  • To post as a guest, your comment is unpublished.
    Jon Williams · 6 years ago
    You can resolve the issue of two attachments with the same name, and create reverse traceability by altering the following line in the code.

    ' Save attachment before deleting from item.
    ' Get the file name.
    sFile = Format(aMail.SentOn, "YYYYMMDDHHNNSS") & "_" & oAttachments.Item(i).FileName

    This will add a date and time stamp in front of the attachment name.
  • To post as a guest, your comment is unpublished.
    Pablo Ruiz · 6 years ago
    This is awesome. However bear in mind if 2 attachments have hte same name, the older one will end up being written over.
  • To post as a guest, your comment is unpublished.
    Mick · 7 years ago
    Exactly what I was looking for - great piece of code - thank you
  • To post as a guest, your comment is unpublished.
    dre · 7 years ago
    Worked like a charm! Thanks a lot
  • To post as a guest, your comment is unpublished.
    Heather · 7 years ago
    Thank you!!! That worked a treat.
    • To post as a guest, your comment is unpublished.
      roland jentsch · 4 years ago
      great, thank you (shame on MS !!!)