dbTalk Databases Forums  

vba code to run winzip

comp.databases.ms-access comp.databases.ms-access


Discuss vba code to run winzip in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
bobh
 
Posts: n/a

Default vba code to run winzip - 04-27-2011 , 11:14 AM






Hi All,

Using AccessXP does anyone have vba code that they would share that
would take a AnyName.PDF file and using WinZip zip it with encryption
to AnyName.zip?

thanks
bobh.

Reply With Quote
  #2  
Old   
Benny Andersen
 
Posts: n/a

Default Re: vba code to run winzip - 04-27-2011 , 12:23 PM






bobh wrote:
Quote:
Hi All,

Using AccessXP does anyone have vba code that they would share that
would take a AnyName.PDF file and using WinZip zip it with encryption
to AnyName.zip?
The 'shell' command runs any external app. Be aware of filenames with
path which can contain spaces - the solution is always to write code
that embeds in double quotes.

Reply With Quote
  #3  
Old   
ron paii
 
Posts: n/a

Default Re: vba code to run winzip - 04-27-2011 , 04:17 PM



"bobh" <vulcaned (AT) yahoo (DOT) com> wrote

Quote:
Hi All,

Using AccessXP does anyone have vba code that they would share that
would take a AnyName.PDF file and using WinZip zip it with encryption
to AnyName.zip?

thanks
bobh.
Winzip command line options: http://www.memecode.com/docs/winzip.html


I use the following code to set the location of the winzip program

' Get path for Zip program Check for 64bin Windows 12/17/2010

If InStr(1, Environ("CommonProgramFiles"), "(x86)") = 0 Then
' 32 bit OS
strZipPath = "c:\program files\winzip\winzip32"
Else
' 64 bit OS
strZipPath = "c:\program files (x86)\winzip\winzip32"
End If

Use Shell to call Winzip

Note: Winzip may open as an Icon at the bottom of the screen. You will need
to click on it to run.

Reply With Quote
  #4  
Old   
Ron Weiner
 
Posts: n/a

Default Re: vba code to run winzip - 04-27-2011 , 08:23 PM



bobh wrote :
Quote:
Hi All,

Using AccessXP does anyone have vba code that they would share that
would take a AnyName.PDF file and using WinZip zip it with encryption
to AnyName.zip?

thanks
bobh.
Why would you want your app to rely on WinZip being installed. Instead
surf over to http://www.info-zip.org/ and check out Info-Zip. Info-Zip
is a Free Ware Zip / UnZip library that can be used directly from
Access programmatically. It comes as a Standard DLL that need NOT be
installed or registered. Just distribute it in the same directory as
you MDB/MDE and invoke it via VBA code.


Rdub

Reply With Quote
  #5  
Old   
Tony Toews
 
Posts: n/a

Default Re: vba code to run winzip - 04-28-2011 , 02:57 PM



On Wed, 27 Apr 2011 21:23:40 -0400, Ron Weiner <NoOne (AT) NoWare (DOT) NutThing>
wrote:

Quote:
Why would you want your app to rely on WinZip being installed. Instead
surf over to http://www.info-zip.org/ and check out Info-Zip. Info-Zip
is a Free Ware Zip / UnZip library that can be used directly from
Access programmatically. It comes as a Standard DLL that need NOT be
installed or registered. Just distribute it in the same directory as
you MDB/MDE and invoke it via VBA code.
Agreed. I've quite happily used this. I don't recall if it supports
encryption though and to what level.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/

Reply With Quote
  #6  
Old   
bobh
 
Posts: n/a

Default Re: vba code to run winzip - 04-29-2011 , 01:40 PM



On Apr 27, 9:23*pm, Ron Weiner <No... (AT) NoWare (DOT) NutThing> wrote:
Quote:
bobh wrote :

Hi All,

Using AccessXP does anyone have vba code that they would share that
would take a AnyName.PDF file and using WinZip zip it with encryption
to AnyName.zip?

thanks
bobh.

Why would you want your app to rely on WinZip being installed. *Instead
surf over tohttp://www.info-zip.org/and check out Info-Zip. *Info-Zip
is a Free Ware Zip / UnZip library that can be used directly from
Access programmatically. *It comes as a Standard DLL that need NOT be
installed or registered. *Just distribute it in the same directory as
you MDB/MDE and invoke it via VBA code.

Rdub
Here in this company WinZip is part of the standard pc configuration
so it just makes sense to use it but thanks for the pointer to another
option.
bobh.

Reply With Quote
  #7  
Old   
bobh
 
Posts: n/a

Default Re: vba code to run winzip - 04-29-2011 , 01:49 PM



On Apr 27, 5:17*pm, "ron paii" <n... (AT) nospam (DOT) com> wrote:
Quote:
"bobh" <vulca... (AT) yahoo (DOT) com> wrote in message

news:0064d3fe-a82c-46cd-98b9-64e6a84c8b30 (AT) t16g2000vbi (DOT) googlegroups.com...

Hi All,

Using AccessXP does anyone have vba code that they would share that
would take a AnyName.PDF file and using WinZip zip it with encryption
to AnyName.zip?

thanks
bobh.

Winzip command line options:http://www.memecode.com/docs/winzip.html

I use the following code to set the location of the winzip program

* * ' Get path for Zip program *Check for 64bin Windows 12/17/2010

* * If InStr(1, Environ("CommonProgramFiles"), "(x86)") = 0 Then
* * * * ' 32 bit OS
* * * * strZipPath = "c:\program files\winzip\winzip32"
* * Else
* * * * ' 64 bit OS
* * * * strZipPath = "c:\program files (x86)\winzip\winzip32"
* * End If

Use Shell to call Winzip

Note: Winzip may open as an Icon at the bottom of the screen. You will need
to click on it to run.
thanks for the link to the winzip command line options as I didn't
even know winzip had them as I was currently looking at the Winzip
command line add-in product ( http://www.winzip.com/prodpagecl.htm ).
bobh.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.