email a dbf file?

  • Thread starter Thread starter Bob Hughes
  • Start date Start date
B

Bob Hughes

Is it possible to email a query in dbf (dbase) format? SendObject does not
appear to have that format.
or conversly export as xls, run excel, output to dbf, mail dbf file

Another similar question is it possible to email a file from excel?

Bob
 
try something like this:

DoCmd.TransferDatabase acExport, "dbase III", "C:\Out\",
acQuery, "mytable", "MyTable.dbf"

Of course to email it you would need the additional code
for that.
 
Thanks that works well, Now if I could just find code to Email a file from
disk
Bob
try something like this:

DoCmd.TransferDatabase acExport, "dbase III", "C:\Out\",
acQuery, "mytable", "MyTable.dbf"

Of course to email it you would need the additional code
for that.
TO reply via e-mail, change the xxx in the address to bob_
 
I have seen quite a bit of code for sending email with or
without one or more attachments. I have tried many of
them. If you are just sending an Access report you can use
the SendObject command. If attachments are files of any
type try the code below. The one below( I have it stored
as a function in a new module) has been the most reliable
for me with MS Outlook and Access 2000. Also I am able to
pull from an open form email address of the recipient, CC,
BCC, and the subject and text and file name of the
attachment(s). Good Luck

Jim

Function SendEMail()
Dim strTo As String, strSubject As String, _
varBody As Variant, strCC As String, _
strBCC As String, strAttachment As String,
strAttachment1 As String

strTo = "email address"
strSubject = "put subject here"
varBody = "put message for body here"
' Add more strattachments if needed and modify IF statement
' below
strAttachment = "attachment1"
strAttachment1 = "attachment2"
'Start Outlook
Dim olApp As Outlook.Application
Set olApp = CreateObject("Outlook.Application")

'Logon
Dim olNs As Outlook.NameSpace
Set olNs = olApp.GetNamespace("MAPI")
olNs.Logon

'Send a message
Dim olMail As Outlook.MailItem
Set olMail = olApp.CreateItem(olMailItem)
'Fill Out and Send Message
olMail.To = strTo
olMail.CC = strCC
olMail.BCC = strBCC
olMail.Subject = strSubject
olMail.Body = varBody
' Modify these statements if more attachmewnts are needed
If Len(strAttachment) <> 0 Then
olMail.Attachments.Add (strAttachment)
If Len(strAttachment1) <> 0 Then
olMail.Attachments.Add (strAttachment1)
End If
End If
olMail.Send

Set olNs = Nothing
Set olMail = Nothing
Set olApp = Nothing

End Function

Jim
 
Back
Top