Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    May 2002
    Location
    Bristol, Avon, England
    Posts
    110
    Thanks
    0
    Thanked 0 Times in 0 Posts

    bulk removal of attachments (xp)

    Does anybody know if it is possible to select a personal/archive folder and remove all the attachments without deleting the email.
    And the icing on the cake would be to leave the name of the file that was previously attached in << >> brackets, similar to what happens when you reply to a mail with attachments.

    Thanks

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: bulk removal of attachments (xp)

    Hi Matt,
    If you're willing to pay (or if this is a one-time deal there is a free trial but I don't know if it's limited functionality) you can try http://www.lbetoolbox.com
    Otherwise you can certainly write code to strip attachments out of an open folder but I doubt you can do it from an archive folder without importing everything back into your personal folder first (I may be wrong, though!)
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: bulk removal of attachments (xp)

    See if the following macro does what you want. I assumed you want to do this from withing Outlook; you'll have to add a few lines and modify a few instructions if you want to call it from another application.

    Sub RemoveAttachments()
    Dim nsp As NameSpace
    Dim fld As MAPIFolder
    Dim itm As MailItem

    On Error GoTo ErrHandler

    Set nsp = GetNamespace("MAPI")
    Set fld = nsp.PickFolder
    For Each itm In fld.Items
    If itm.Attachments.Count > 0 Then
    Do While itm.Attachments.Count > 0
    itm.Body = itm.Body & vbCrLf & _
    "<<" & itm.Attachments(1).DisplayName & ">>"
    itm.Attachments.Remove 1
    Loop
    itm.Save
    End If
    Next itm

    ExitHandler:
    Set itm = Nothing
    Set fld = Nothing
    Set nsp = Nothing
    Exit Sub

    ErrHandler:
    MsgBox Err.Description, vbExclamation
    Resume ExitHandler
    End Sub

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: bulk removal of attachments (xp)

    Rory,

    The macro in my other reply in this thread works on archive folders too (I tested it on a duplicate of one of my archive folders)

  5. #5
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: bulk removal of attachments (xp)

    Thanks, Hans - that's extremely good to know at this moment in time! (we're in the process of installing an email vault and they will be gathering up all the existing archive folders soon but they have said my mailbox is too big already! <img src=/S/grin.gif border=0 alt=grin width=15 height=15>)
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •