Zip de fichier via VB

logik51 - 4 mai 2001 à 11:03
cs_romain35000 Messages postés 2 Date d'inscription jeudi 3 décembre 2009 Statut Membre Dernière intervention 21 juin 2010 - 21 juin 2010 à 19:32
Salut,

Je souhaiterai zipper un fichier Via VB...
Quelqu'un peut m'aider ?

Merci.

A+

7 réponses

Si tu as une réponse, je serai heureux de l'avoir.
Je recherche la même chose ...
Si je trouve, je pense à toi !!!
0
Vous pouvez utiliser ActiveZipper, un OCX à mettre sur le form concerné.
0
Réponse:

zipIT = path & "winzip32 -a " 'va permettre d'éxécuter des commandes zip automatiquement

path: chemin ou se trouve ton programme zip (ex: c:\Win95\Program\Winzip.exe)

Shell (zipIT & targetPath & "C:\toto.txt") 'Zipper le fichier dans le bon répertoire

targetPath: nom du fichier complet (ex: "c:\temp\toto.zip")
"c:\toot.txt" est le fichier que l'on veut zipper.

si tu veux zipper plusieurs fichiers à la fois, mets le nom des ces fichiers dans un fichier temporaraire et lance la ligne suivante:

Shell (zipIT & targetPath & "@" & "C:\fichier_temp.txt")

où dans fichier temp il y a par exemple:

c:\toto.txt
c:\titi.txt
c:\tata.txt
c:\tutu.txt

qui sont tous les fichiers que tu veux zipper.
0
cs_Zoltan67 Messages postés 91 Date d'inscription mercredi 18 décembre 2002 Statut Membre Dernière intervention 25 juin 2003 1
6 juin 2003 à 16:48
et voici les différentes option à utiliser avec Winzip, en paramètres pour ceux qui, comme moi, ont cherché comment faire (bon, en anglais, mais faut pas trop en demander ;o)
'Adding Files:
'The command format is:
'winzip[32].exe [-min] action [options] filename[.zip] files
'where:
'-min specifies that WinZip should run minimized. If -min is specified,
'it must be the first command line parameter.
'Action
'-a For add, -f for freshen, -u for update, and -m for move. These
'actions correspond To the actions described In the section titled
'"Adding files To an Archive" in the online manual.
'Options
'-r and -p correspond To the "Recurse Directories" and "Save Extra
'Directory Info" checkboxes in the Add and Drop dialog boxes. -ex, -en,
'-ef, -es, and -e0 options determine the compression method: eXtra,
'Normal, Fast, Super fast, and no compression. The default is "Normal".
'-s allows specification of a password. The password can be enclosed
'In quotes, For example, -s"Secret Password". Note that passwords are
'case-sensitive.
'-hs option allows hidden and system files To be included.
'FileName.zip
'Specifies the name of the ZIP involved. Be sure To use the full
'filename (including the directory).
'Files
'Is a list of one or more files, or the @ character followed by the
'filename containing a list of files To add, one filename per line.
'Wildcards (e.g. *.bak) are allowed.
'Extracting Files:
'The command format is:
'winzip[32].exe -e [options] filename[.zip] directory
'where:
'-e Is required.
'Options
'-o and -j stand For "Overwrite existing files without prompting" and
'"Junk pathnames", respectively. Unless -j is specified, directory
'information is used.
'-s allows specification of a password. The password can be enclosed
'In quotes, For example, -s"Secret Password". Note that passwords are
'case-sensitive.
'FileName.zip
'Specifies the name of the ZIP involved. Be sure To specify the full
'filename (including the directory).
'directory
'Is the name of the directory to which the files are extracted. If the
'directory does Not exist it is created.
'Notes:
'* VERY IMPORTANT: Always specify complete filenames, including the full
'path name and drive letter, For all file IDs.
'* To run WinZip in a minimized inactive icon use the "-min" option.
'When specified this option must be the first option.
'* Only operations involving the built-in zip and unzip are supported.
'* Enclose Long filenames on the command line in quotes.
'* NO leading or trailing blanks, or blank lines For readability, are
'allowed In list ("@") files.
'* The action and Each option on the command line must be separated
'from the others by at least one space.
'* WinZip can be used To compress files With cc:Mail . Change the
'compress= line in the [cc:Mail] section of the appropriate WMAIL.INI
'files To specify the full path For WinZip followed by "-a %1 @%2".
'
'
'For example, If WinZip is installed in your c:\winzip directory,
' specify
' compress=c:\winzip\winzip.exe -a %1 @%2
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
EPS32HAY Messages postés 100 Date d'inscription vendredi 20 décembre 2002 Statut Membre Dernière intervention 1 février 2009
5 oct. 2004 à 10:29
Ca marche c'est génial,

Maintenant , il faut que je réussisse à le mettre dans mon code,

Merci beaucoup pour la solution, qui m'aide vraiment...

@+ banne programmation
EPS32HAY :)
0
Gunshin82 Messages postés 37 Date d'inscription jeudi 22 mars 2007 Statut Membre Dernière intervention 10 décembre 2009
27 mars 2007 à 14:23
Bonjour,

Tout d'abords, merci beaucoup à lianys et à Zoltan67, vous avez répondu à presque toute les questions que j'étais pour demandé mais il m'en reste une, voici la situation :

J'ai un fichier zip contenant plus de 100 fichiers, je voudrais extraire que ceux contenant disons le code 500 à l'intérieur de sont nom. Comment pourrais-je faire pour que mon code VBA puisse filtrer les fichiers et extraire que ceux qui s'applique à ce filtre ?

Merci par avance,
Gunshin82
0
cs_romain35000 Messages postés 2 Date d'inscription jeudi 3 décembre 2009 Statut Membre Dernière intervention 21 juin 2010
21 juin 2010 à 19:32
Bonjour moi je voudrais savoir comment ouvrir un fichier powerpoint pptx, je galere un peu!! si quelqu'un peut m'aider ?

Merci.

A+
0
Rejoignez-nous