Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using WinZip Command Line in Access VBA

Status
Not open for further replies.

jimswork1341

Programmer
Oct 13, 2015
3
0
0
US
Hey all.

I've been tasked with getting Access VBA to zip files that are inside "folder1", and then move those zipped files to "folder2", and save the zipped file there.

I'm going to keep it simple: Does anyone know what code I would need to use, in order to get this done? I will need to build on this, but I just want to deal with this step for now.

Thanks!

(I do have the WinZip Command Line at my disposal.)
 
Thanks! That helped a lot.

I still have a nagging question, though.

I can't seem to get it to zip more than one file at a time... and if I name the folder that these multiple files reside in, it actually zips the folder as well (I just want the files).

What I'm using is:

.NameSpace("C:\Users\LID4IA1\Desktop\WinZip Test\VBA TEST\Source\testzip.zip").CopyHere "C:\Users\LID4IA1\Desktop\WinZip Test\Source\*.*"

If I try to use those wildcards to grab every file in the "Source" folder, it tells me "the file name you specified is not valid or too long".

If I just put: .CopyHere "C:\Users\LID4IA1\Desktop\WinZip Test\Source\" , it will copy the "Source" folder, as well as everything in it.

I just need it to grab the files IN the source folder, not the folder itself.

 
Did you note the Commented line that indicated "'use this line if we want to zip all items in a folder into our zip file"?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top