send email button on a form

  • Thread starter Thread starter pierre
  • Start date Start date
P

pierre

Hi all,

When the user press a button on a form,
i want to send a mdb file by email

How can i do that?

The docmd.sendobject has no attachement option

if i use
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strbody = "Salut" & vbNewLine & vbNewLine & _
"Fichier de données" & vbNewLine & _
"" & vbNewLine & _
"" & vbNewLine & _
""



On Error Resume Next
With OutMail
.to = "(e-mail address removed)"
.CC = "(e-mail address removed)"
.BCC = ""
.Subject = "Inventaire " & strinvno & " Dollarama "
.Body = strbody
.Attachments.Add FileNameZip
.Send 'or use .Display

End With

On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing
Set oApp = Nothing


i have a message "an activex object cannot create object"
regards,
pf
 
I get the same error if I try running your code on my machine... though it's
pretty clear what my problem is as I don't have Outlook installed. You do?

All you could ever want to know about mailing from Access from Tony Toews -
http://www.granite.ab.ca/access/email.htm

Tony - if you read this then I just spotted this on there: "Note the lack of
frames, animated graphics, Java and Flash on this website. This is a low
bandwidth site full on content. Not useless fancy eye catching fluff which
marketing types figure will seize your attention. Just solid information."

Well said that man.
 
Back
Top