Zipping a mdb-file

R

reidarT

How can I zip a mdb-file.
My problem is I have an export to a mdb-file.
This file goes as an attachment to Outlook.
I need to zip this mdb-file both to reduse the size and also to get it sent
with Outlook.
By now I use pkzip with a shell argument, but I would like to make all the
programming
in access.
reidarT
 
B

Bill

I use Winzip with its "Command Line" interface to
Zip the desired MDF, but I use ShellWait (just
Google ShellWait) to launch Winzip. To then
send as an e-mail, it depends on whether you're
using Outlook or Outlook Express. I use the
latter, so it's necessary to use SendMailWithOE
when running directly from VBA. Maybe not the
best of all worlds, but my client's situation required
such a configuration. (You can Google SendMailWithOE
to obtain the module.)
Bill
 
A

Albert D. Kallal

I have a zipping routine here:

http://www.members.shaw.ca/AlbertKallal/zip/index.htm

The above runs without you having to install winzip.
(and, you don't have to use shell commands to
pkzip or installing pkzip).

Once you create the file, then you simply start a outlook session, and
attacch the file you made as above:

eg:
' send to user via email
'Dim ol As Outlook.Application
Dim ol As Object ' Late binding 10/03/2001 -
Ak
'Dim ns As NameSpace
Dim ns As Object ' Late bind
'Dim newmessage As MailItem
Dim newmessage As Object ' Late bind

Dim mymessage As String
'Dim objOutlookAttach As Outlook.Attachment
'Dim objOutlookAttach As Object

Set ol = GetObject(, "Outlook.Application")
Set ns = ol.GetNamespace("MAPI")
ns.Logon
Set newmessage = ol.CreateItem(0) ' 0 = olMainItem
With newmessage
.Recipients.Add strEmailTo
.Subject = strSubject
.Body = strMsgText
'Set objOutlookAttach = .Attachments.Add(stDocName)
.Attachments.Add (strDocName)
.Display
' .Send
End With
 

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