Saving to a zip archive

D

DeanL

Hi all,

I have an interesting problem that I hope someone may be able to help
with. I have a macro that creates a text file from a word document
and saves it to a specific location on my server but I need to somehow
have the text file automatically added to a zip file. The zip file
may or may not exist yet but if it does and there is another version
of the text file inside the zip file then the new one should overwrite
it. I'm trying to accomplish this with Word so no outside
interference is required (and it enables me to somewhat idiot proof
the process).

Any help or advice would be greatly appreciated.

Many thanks.
 
J

Jay Freedman

DeanL said:
Hi all,

I have an interesting problem that I hope someone may be able to help
with. I have a macro that creates a text file from a word document
and saves it to a specific location on my server but I need to somehow
have the text file automatically added to a zip file. The zip file
may or may not exist yet but if it does and there is another version
of the text file inside the zip file then the new one should overwrite
it. I'm trying to accomplish this with Word so no outside
interference is required (and it enables me to somewhat idiot proof
the process).

Any help or advice would be greatly appreciated.

Many thanks.

If you install a zip utility such as WinZip or WinRAR on the server, you can
write a VBA macro in Word that uses the Shell method to send a command line
to the utility. This method is adequately documented in the VBA help.

For WinZip you need to download a command-line interface from
http://www.winzip.com/downcl.htm. As far as I can tell from the web site
(www.rarlabs.com), WinRAR's command line interface is built in.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top