Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unzip files in Outlook using VBA

Status
Not open for further replies.

Corbie

Technical User
Nov 19, 2001
21
GB
Hi

I'm trying to unzip files using VBA from within outlook, but can't get it to work.

This is the code I'm trying

Sub UnZipaFile()
UnZipFile ZipedFileName:="c:\123r5w\work\accounts\qhop0903.zip", _
TargetDirectory:="c:\accounts\", _
UnZipOptions:="-o -d"
End Sub




Function UnZipFile(ZipedFileName As String, _
Optional TargetDirectory As String, _
Optional UnZipOptions As String)
Dim Wzunzip
Dim UnZipCommandLine
Dim TaskID
Wzunzip = "C:\Program Files\WinZip\Wzunzip.exe"
UnZipCommandLine = Wzunzip & " " & UnZipOptions & " " & ZipedFileName _
& " " & TargetDirectory
TaskID = Shell(UnZipCommandLine, vbHide)
End Function

I don't get any error messages it doesn't work. Has anybody got a clue of indeed a better way of doing it

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top