Here is a function that
Const WIN_ZIP As String = """C:\Program Files\Winzip\wzzip"""
Function ZipFiles(sZipFileName As String, sFileToZip As String) As Boolean
Dim sCommand As String
sCommand = WIN_ZIP & " -yb -a " & sZipFileName & " " & sFileToZip
Shell sCommand
End Function
John Burdek
Programmer Analyst
Saint Clare's Health System
66 Ford Road
Denville, NJ 07834
Phone: (973) 983-1532
Pager: (973) 259-2721
Fax: (973) 983-1530
[email protected] <mailto:[email protected]>
________________________________
From: [email protected] [mailto:[email protected]]
Sent: Tuesday, January 13, 2009 9:39 AM
To: [email protected]
Subject: [talkbws] RE: .Zip file question
Greetings,
If I remember correctly, you need to use the below routines like
commands within a third routine. Any routine that accepts parameters cannot be
run on their own - sort of like telling someone to jump but not saying how high.
Take the example code from the website, paste into a project. Then
create another routine that uses the below.
Sub main()
NewZip "c:\test.zip" ' This creates the empty zip file.
FillZip "c:\test.zip", "c:\test.txt" ' This puts text.txt into the
empty zip file
End Sub
Regards,
Thom
Thom C. Blackwell
Product Manager
Boston Software Systems
(866) 653-5105 ex 807
www.bossoft.com <http://www.bossoft.com/>
Sign up for my weekly webinar!
<http://www.bostonworkstation.com/customer_center/special_events.aspx>
LEGAL NOTICE Unless expressly stated otherwise, this message is
confidential and may be privileged. It is intended for the addressee(s) only.
Access to this E-mail by anyone else is unauthorized. If you are not an
addressee, any disclosure or copying of the contents of this E-mail or any
action taken (or not taken) in reliance on it is unauthorized and may be
unlawful. If you are not an addressee, please inform the sender immediately,
then delete this message and empty from your trash.
From: [email protected] [mailto:[email protected]]
Sent: Monday, January 12, 2009 2:20
To: Talk
Subject: [talkbws] .Zip file question
Hi everyone,
Does anyone have an in-production example of creating a compressed
zipped file? I found the code below in the script center, but when trying on my
PC, I pushed F8 to step through and all it does is make a noise and sit on the
same line. It doesn't step into the code. I have also never written a script
that passes the parameter like that (in the sub definition). Am I missing a
parameter/variable definition? Any complete in-production examples would be
appreciated.
http://www.bostonworkstation.com/customer_center/script_center/script_details.aspx?id=303&cat=20
Sub NewZip(sPath)
'Create empty Zip File
Dim oFSO, arrHex, sBin, i, Zip
Set oFSO = CreateObject("Scripting.FileSystemObject")
arrHex = Array(80, 75, 5, 6, 0, 0, 0, _
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
For i = 0 To UBound(arrHex)
sBin = sBin & Chr(arrHex(i))
Next
With oFSO.CreateTextFile(sPath, True)
.Write sBin
.Close
End With
End Sub
Sub FillZip(ZipFile, addFile)
Set oApp = CreateObject("Shell.Application")
oApp.NameSpace(ZipFile).CopyHere addFile
End Sub
--------------------------------------------------------------------
Heather Castillo
HPMIN Analyst/Module Coordinator
Information Systems
Hays Medical Center
785.623.5084 office
785.623.5594 fax
[email protected]
"Shoot for the moon...even if you miss, you'll always land among the
stars."
NzbunzRnrqzyârrqzjzj
DISCLAIMER: Saint Clare's Health System Confidentiality Notice: This e-mail
and any accompanying documents may be confidential and/or legally privileged.
If you are not the intended recipient, you are hereby notified that any
disclosure, copying, distribution or the taking of any action in reliance on
the contents of this information is strictly prohibited. If you have received
this e-mail in error, please notify the sender immediately by reply e-mail and
delete the message and any attachments. Thank you.
---
To post a message to this list, send mail to: [email protected]
You are currently subscribed as: [email protected]
Unsubscribe in the customer center on our website:
http://www.bostonworkstation.com/customer_center/virtual_user_group_talk.aspx