You can send document INSIDE the database,
docmd.SendObject acSendReport,"report",acformatPDF,sTo,,,sSubj, sMsg,false
but if they are not in the db, then you must use a lot of code,below:
usage:
Code:
if Email1( "bob@co.com","subject", "body text", "c:\folder\file.pdf") then
msgbox "email sent"
else
msgbox "email failed"
endif
Code:
Public Function Email1(ByVal pvTo, ByVal pvSubj, ByVal pvBody, Optional ByVal pvFile) As Boolean
Dim oApp As Outlook.Application
Dim oMail As Outlook.MailItem
On Error GoTo ErrMail
'NOTE : YOU MUST HAVE THE OUTLOOK REFERENCE CHECKED IN VBE; ctl-G, menu,tools, references
Set oApp = CreateObject("Outlook.Application")
Set oMail = oApp.createitem(olmailitem)
With oMail
.To = pvTo
.Subject = pvSubj
If Not IsNull(pvBody) Then .Body = pvBody
If Not IsMissing(pvFile) Then .Attachments.Add pvFile, olByValue, 1
.Display True
'.Send
End With
Email1 = True
endit:
Set oMail = Nothing
Set oApp = Nothing
Exit Function
ErrMail:
MsgBox Err.Description, vbCritical, Err
Resume endit
End Function