Oh no, you can't be satisfied with the code, you gotta pick apart spelling errors in the header ...
well, if it is that bac, then don't use it
I played with it a bit last night and realized that there is a problem with the utility to zip all files in a folder to a single file IF the zip file is located in the same folder in which all files are being compressed.
example:
You have a folder C:\Stuff\Pictures\ and you want to compress all of the files in that folder to a file called C:\Stuff\Pictures\Pictures.zip When using the built in Windows compression (or any other zip utility) you generally select the files prior to the compression taking place. In this utility, the files are compressed as they are selected, this means that C:\Stuff\Pictures\Pictures.zip will be selected to be compressed into itself, clearly this will not be possible.
A fix for that situation might be as follows:
(defun AddFolder2Zip (srcFolder destFile)
(MakeEmptyZip destFile)
(setq app (vlax-create-object "Shell.Application"))
(setq folder (vlax-invoke app 'NameSpace srcFolder))
(setq destZip (vlax-invoke app 'NameSpace destFile))
(setq files (vlax-invoke folder 'Items))
(setq count (vlax-get-property files 'Count))
(setq ndx 0)
(repeat count
(setq file (vlax-invoke files 'Item ndx))
(if (/= (strcase (vlax-get-property file 'Name))(strcase(strcat (cadr (fnsplitl destFile))(caddr (fnsplitl destFile)))))
(vlax-invoke destZip 'CopyHere file)
)
(setq ndx (1+ ndx))
)
)
This will verify whether the zip file is actually being selected to be compressed and will skip it if needed.
I am adding additional error checking, and I have already determined that some systems handle the compression differently. For example, my home computer prompts you to overwrite the files in the zip file if they already exist, while my office computer will simply add the file again (thus there are 2 of the exact same files in the zip).
Determining if the file exists in the zip file should be as easy as:
(member (GetAllFilesInZip "MyFile.dwg"))
I am not sure how capitalization works in that scenario as I have not tested it.
I am glad everyone is finding it useful though.