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."

 

N�h�֦z���h���+-��ݙ����Z�F�����&b����.����\����&�u���b�隊V�r�y�&R{.n�+�����^r�-�g�q��z�'���y�"��m����
��h�
+��Z�*'r��r�-�g�q��z�nj[�z�+��mjY��

Reply via email to