# Auto un-ZIP attachments in Outlook



## Reactor (May 3, 2012)

Hi,

I have a macro in outlook that automatically saves attachments from a certain email folder. The problem I have is that the attachments are ZIP files and I keep getting pop-ups to manually decompress them. Is there code I can use that will automatically un-ZIP the attachments?

Thanks.


----------



## JP2112 (May 8, 2012)

I have some code here that can automatically decompress zip files using an event handler in Outlook.

http://www.jpsoftwaretech.com/saving-compressed-attachments-in-windows-7outlook-2003/


----------



## Reactor (May 10, 2012)

Hi,

I appreciate you looking at my problem but the link you have provided doesn't do exactly what I'm looking for and my programming is not that good to get it to where I want. 

I'll show you the code I have so you can see what I'm doing. I just want to modify my code so that I don't get the popup windows asking if I want to decompress.


```
Sub SaveAttachmentsToFolder()
' Declare variables
    Dim ns As NameSpace
    Dim Inbox As MAPIFolder
    Dim SubFolder As MAPIFolder
    Dim item As Object
    Dim Atmt As Attachment
    Dim fileName As String
    Set ns = GetNamespace("MAPI")
    Set Inbox = ns.GetDefaultFolder(olFolderInbox)
    Set SubFolder = Inbox.Folders("Special") ' Enter correct subfolder name.
    On Error Resume Next

' Check each message for attachments
    For Each item In SubFolder.Items
        For Each Atmt In item.Attachments
                fileName = "H:\Special\" & _
                    Atmt.fileName
                Atmt.SaveAsFile fileName
        Next Atmt
    Next item
End Sub
```


----------



## JP2112 (May 11, 2012)

Can you post the text of the popup message?


----------



## Reactor (May 16, 2012)

I get the following pop up message for every attachment:

'You are about save a .zip file.
Do you want to automatically decompress this file: '


----------

