Auto un-ZIP attachments in Outlook

Reactor

New Member
Joined
Nov 22, 2008
Messages
26
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.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
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.

Code:
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
 
Upvote 0
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: '
 
Upvote 0

Forum statistics

Threads
1,225,617
Messages
6,186,017
Members
453,334
Latest member
Prakash Jha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top