Connecting Tech Pros Worldwide Forums | Help | Site Map

Code to Unzip file from Outlook message

Jim
Guest
 
Posts: n/a
#1: Nov 13 '05
I have a user who works remotely who just does not understand the
concept of zipping and unzipping files no matter how many times I
explain it. I need to create something for her that will do the
following:

* She receives an outlook message with a zipped file and opens the
message.
* She opens an Access "Utilities" database and clicks a button labeled
"Unzip updated database from eMail message"
* Somehow the code behind the button looks for the open eMail message,
unzips the attached file, and places it in "E:\NewDB\Data.mdb"
overwriting the existing Data.mdb file that's there.

Can this be done? Any help would be appreciated!


polite person
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Code to Unzip file from Outlook message


On 21 Jul 2005 06:21:19 -0700, "Jim" <jlrehmann@gmail.com> wrote:
[color=blue]
>I have a user who works remotely who just does not understand the
>concept of zipping and unzipping files no matter how many times I
>explain it. I need to create something for her that will do the
>following:
>
>* She receives an outlook message with a zipped file and opens the
>message.
>* She opens an Access "Utilities" database and clicks a button labeled
>"Unzip updated database from eMail message"
>* Somehow the code behind the button looks for the open eMail message,
>unzips the attached file, and places it in "E:\NewDB\Data.mdb"
>overwriting the existing Data.mdb file that's there.
>
>Can this be done? Any help would be appreciated!
>[/color]
Yes but other things would be much easier if you can find an interface that she understands.
For instance, could she drag the attachment from outlook and drop it on an icon on the
desktop or in the folder you use? This could be a batch file or script which does whatever you want.

Jim
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Code to Unzip file from Outlook message


Yes, I could have her drop it on the desktop...

King Ron
Guest
 
Posts: n/a
#4: Nov 13 '05

re: Code to Unzip file from Outlook message


WinZip provides a command line utility that interfaces with WinZip and
accepts variable input. You can SHELL to that utility passing the
zip/unzip action and command line parameters as a string.

http://www.winzip.com/downcl.htm

The command line utility help file provides syntax for the command line
parameters.

Here's a snitch of code from one of my projects. This will take a
variablly named text file and zip it into a variably password protected
zip file in the background.

<compiled code>
wkPath = GetFilePath(CodeDb.Name) & "DataFiles\"
ChDir wkPath

wkText = wkPath & Me.ufISACFtpSource
wkZipt = wkPath & Me.ufISACFtpDest
wkDest = Me.ufISACFtpDest

wkCmnd = "C:/Program Files/WinZip/wzzip.exe -s" & Me.ufISACFtpPwd & "
""" & wkZipt & """ """ & wkText & """"
OK = Shell(wkCmnd, vbMinimizedNoFocus)

</compiled code>

Outlook is a programmable interface that will enable you to manipulate
its data store programmatically. I've never done it, but you should be
able set a reference to the outlook libraries in order to manipulate
them from Access.

Another alternative might be to license the WinZip self-extractor. If
you can get an attached executable past the corporate firewall, all
your user would have to do is double-click the attached executable.

Oops. Did I say that out loud?

King Ron of Chi

Closed Thread


Similar Microsoft Access / VBA bytes