Autosave & extract Zip attachment VBA Outlook/Excel

joeri247

New Member
Joined
Apr 29, 2016
Messages
1
Hi Everybody,

In combination with rules & alerts I manage to automatically save a certain ZIP file (containing 1 file) to a directory specified below.
However, to be able to work with this file in a macro it has to be automatically extracted in this directory as well. Doing this extract, the file needs to get todays date because the purpose is to have updated figures in the same directory every day. Could somebody help me out please ? I already had a look at simular post and solutions like "http://www.rondebruin.nl/win/s7/win002.htm", but as I am all knew at this I can't figure out to make it work for my particular case.

Code:
Public Sub Save118(itm As Outlook.MailItem)


Dim objAtt As Outlook.Attachment
Dim saveFolder As String
Dim StrYear As String
Dim DateFormat As String

 StrYear = Year(Date)
DateFormat = Format(Now, "dd-mm-yyyy")
saveFolder = "T:\Transfer\Business Intelligence\Sales planning\Archive\AMlink report archive\118EMEA\" & StrYear

 For Each objAtt In itm.Attachments
objAtt.SaveAsFile saveFolder & "\" & DateFormat & " " & objAtt.DisplayName
Set objAtt = Nothing
Next

If the only code that exists is to difficult to implement for a beginner, a piece of code to let me work with ZIP files in my VBA excel would help me out as well of course.

Thank you in advance.

Kind Regards
Joeri
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,216,737
Messages
6,132,436
Members
449,727
Latest member
Aby2024

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