By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,718 Members | 1,220 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,718 IT Pros & Developers. It's quick & easy.

Winzip (wzzip.exe) via access

P: n/a
Hi

I am using the following code to zip up a selected folder but it
doesn't work and I get the msg saying the file doesn't exist but it
does exist, please help - thanks

---[code]---

Set objFSO = CreateObject("Scripting.FileSystemObject")

sTempZipFolder = "c:\Temp"
sFileName = Me.txtFileToZipAttach.Value
sZipName = sTempZipFolder & "\Reports.zip"

If objFSO.FileExists(sFileName) Then
MsgBox sFileName & " exists"
Set objShell = CreateObject("WScript.Shell")
Set objCmd = objShell.Exec("C:\Program Files\WinZip\wzzip.exe
-ybc" & " " & sZipName & " " & sFileName, 1, True)
Set objCmd = Nothing
Set objShell = Nothing

Else
MsgBox sFileName & " doesn't exist"

End If

---[code]---
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
mr_ocp wrote:
Hi

I am using the following code to zip up a selected folder but it
doesn't work and I get the msg saying the file doesn't exist but it
does exist, please help - thanks

---[code]---

Set objFSO = CreateObject("Scripting.FileSystemObject")

sTempZipFolder = "c:\Temp"
sFileName = Me.txtFileToZipAttach.Value
sZipName = sTempZipFolder & "\Reports.zip"

If objFSO.FileExists(sFileName) Then
MsgBox sFileName & " exists"
Set objShell = CreateObject("WScript.Shell")
Set objCmd = objShell.Exec("C:\Program Files\WinZip\wzzip.exe
-ybc" & " " & sZipName & " " & sFileName, 1, True)
Set objCmd = Nothing
Set objShell = Nothing

Else
MsgBox sFileName & " doesn't exist"

End If

---[code]---


Try using:
If Len(Dir$(sFileName)) Then
....
--
Error reading sig - A)bort R)etry I)nfluence with large hammer
Nov 13 '05 #2

P: n/a
mr****@hotmail.com (mr_ocp) wrote in message news:<7e**************************@posting.google. com>...
Hi

I am using the following code to zip up a selected folder but it
doesn't work and I get the msg saying the file doesn't exist but it
does exist, please help - thanks

---[code]---


Phil Stanton does something similar in a recent post:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=40e98d63%240%24111%2465c69314%40mercury.nil dram.net

James A. Fortune
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.