how can i send ms access reports attached to Outlook email templat

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a possible way to eliminate my 2 step process of creating reports in
MS Access, and then attaching them to Outlook email templates?
Thanks
 
Brian,
Have you checked out the SendObject method?
Not sure what you mean by an OE "template", but SendObject will attach the report to an
email, open OE, and all you have to do is Send.
You can also control the TO, BODY, Send to a Group, etc...
 
Briain ha scritto:
Is there a possible way to eliminate my 2 step process of creating reports in
MS Access, and then attaching them to Outlook email templates?
Thanks

Of course.
Osing SendObject method you use dhe default MailBrowser, but you need
to transform the Report on a SnapShots

DoCmd.SendObject acSendReport, stDocName,"Snapshot Format" [, to][,
cc][, bcc][, subject][, body]

This one require that the receiver have SnapshotsViewer on its
machine..... it's not so easy....!

Is much better print like PDF on a Virtual printer and send the
attachment/s

You do not specifie if Outlook is OE or MSO...?

In 2° case you can use also Automation

Sub SendMailAutomation()
Dim Ol_App As New Outlook.Application
Dim Ol_Item As Outlook.MailItem
Set Ol_Item = Ol_App.CreateItem(olMailItem)

With Ol_Item
.To = "(e-mail address removed)"
.subject = "Objet message"
.Body = "Body message"
.Attachments.Add "C:\PrintedReport.pdf"
' if you need to store on a SentItems
.Save
.send
End With
Set Ol_Item = Nothing
Set Ol_App = Nothing
End Sub

Also is possible to use MAPI or CDO...... or Winsock.....

Bye
@Alex
 
Briain said:
Is there a possible way to eliminate my 2 step process of creating reports in
MS Access, and then attaching them to Outlook email templates?

A2000ReportToPDF is an Access 2000 database containing a function to
convert Reports and Snapshot files to PDF documents. No PDF Printer
driver is required.
http://www.lebans.com/reporttopdf.htm

For a page on how to print a report for a single record and how to
generate reports to attach to emails see the Emailing reports as
attachments from Microsoft Access page at
http://www.granite.ab.ca/access/email/reportsasattachments.htm

Tony

--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
Tony, we created a command button with the following expression, click
the button the your email opens with the form attached.

Private Sub Image455_Click()
On Error GoTo Err_cmdEmailCARReport_Click

Dim stDocName As String

stDocName = "rptCorrectiveActionEmail"
If IsNull(Me![Email Address]) Then
DoCmd.SendObject acReport, stDocName, acFormatRTF, , , , "Car
Update", "The attached CAR requires your attention"
Else
DoCmd.SendObject acReport, stDocName, acFormatRTF, Me![Email
Address], , , "Car Update", "The attached CAR requires your attention"
End If
Exit_cmdEmailCARReport_Click:
Exit Sub

Err_cmdEmailCARReport_Click:
MsgBox Err.Description
Resume Exit_cmdEmailCARReport_Click
End Sub
 
Patty said:
Tony, we created a command button with the following expression, click
the button the your email opens with the form attached.

And that's working for you then? Ah yes, there is a third approach
which I forgot about. The query that the report is based on can have
a criteria field referencing form controls.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 

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

Back
Top