WinZip extract

  • Thread starter Thread starter Keith
  • Start date Start date
K

Keith

I downloaded the WinZip command line add-on from the WinZip website. I
have a macro in EXCEL 97 that downloads a file and when the file is
downloaded, it opens as a zip file.

Two things that I ask:

1. Do I need to do anything in my VBA window to activate the add-on?

2. How can I extract the file (with code) that is inside the zip
window? In looking at other posts I've seen something like...
Shell("C:\whatever path\WZUNZIP.exe bla bla bla")
I put bla bla bla because I have no idea what any of the stuff
following the .exe path means in those posts.

Any ideas? Thanks.
 
Try this for unzip test.zip from C:\ to C:\

Sub test()
Shell "c:\program files\winzip\wzunzip c:\test.zip c:\"
End Sub
 
Thanks for your help on using the Shell command. That part is
definitely cleared up.

But my other problem is this:

I am doing a FollowHyperlink to download a .zip file. Upon downloading
I would get the pop-up box asking me if I wanted to run the file from
the location or save it. I couldn't figure out how to bypass that
pop-up box with VBA and have it automatically save to a specific
folder, so I decided to click "Save" and I unchecked the box that says
"Always ask this for this type of file" so I wouldn't get that
anymore. And now when I test this code, the .zip file downloads and
opens after downloading (even though I told it to always save). So the
..zip file opens and I see the file that needs to be unzipped. But the
problem is, I would have liked to have specified where to save that
..zip file so that I could easily use Shell. (Remember this is Excel
97.)

Anybody know what I can do?

Thanks....Keith
 
Hi Keith

With this you can place all the files in the Outlook folder Yourfolder to
To a folder (C:\Filefolder) on your harddisk

Sub SaveAtt()
Dim ol As Outlook.Application
Dim ns As NameSpace
Dim Fldr As MAPIFolder
Dim Mi As MailItem
Dim Att As Attachment

Set ol = New Outlook.Application
Set ns = ol.GetNamespace("MAPI")
Set Fldr = ns.GetDefaultFolder(olFolderInbox).Folders("Yourfolder")

For Each Mi In Fldr.Items
If Mi.Attachments.Count > 0 Then
For Each Att In Mi.Attachments
Att.SaveAsFile "C:\Filefolder\" & Att.Filename
Next Att
End If
Next Mi

Set Att = Nothing
Set Mi = Nothing
Set Fldr = Nothing
Set ns = Nothing
Set ol = Nothing

End Sub
 
Thanks so much Ron! I'll give it a shot.

Ron de Bruin said:
Hi Keith

With this you can place all the files in the Outlook folder Yourfolder to
To a folder (C:\Filefolder) on your harddisk

Sub SaveAtt()
Dim ol As Outlook.Application
Dim ns As NameSpace
Dim Fldr As MAPIFolder
Dim Mi As MailItem
Dim Att As Attachment

Set ol = New Outlook.Application
Set ns = ol.GetNamespace("MAPI")
Set Fldr = ns.GetDefaultFolder(olFolderInbox).Folders("Yourfolder")

For Each Mi In Fldr.Items
If Mi.Attachments.Count > 0 Then
For Each Att In Mi.Attachments
Att.SaveAsFile "C:\Filefolder\" & Att.Filename
Next Att
End If
Next Mi

Set Att = Nothing
Set Mi = Nothing
Set Fldr = Nothing
Set ns = Nothing
Set ol = Nothing

End Sub
 
After taking a look at this, I guess I just really don't understand
what this does, and why Outlook is involved. It seems that this would
just look for attachments in my Outlook and save them somewhere else.
And the file that I am downloading doesn't come from e-mail. Any way I
can get just a brief explanation on how this works? Thanks!

Keith
 
Hi Keith

Sorry you say Download (I must read before I answer <g>)

I will test it this evening
I post back today
 
Hi Keith

Check out this(not test it myself)

The free WinZip® Internet Browser Support Add-On will automate much of the work normally associated with downloading compressed
files from the Internet. When you click on a Zip file using Microsoft Internet Explorer or Netscape Navigator/Communicator,
WinZip will take over when the download is completed. WinZip automatically moves the downloaded file to your download folder
(initially set to c:\download) and then, optionally opens the file.
http://www.winzip.com/ibrowser.htm
 
Back
Top