Re: Emailing report data



Thanks Alex!

What is the best way to implement this?

Regards
Greg

"Alex Dybenko" wrote:

Hi,
should work now, anyway - here it is:
Public Sub olSendRpt(strTo As String, strBody As String, strSubject As
String, strReportName As String)
'A procedure to send report in a body of mail message
'Alex Dybenko, http://Alex.Dybenko.com

'Usage: olSendRpt "Send@xxxxxx", "Pls see report below", "My Report",
"Report1"


Dim strFileName As String, intFile As Integer, strLine As String,
strTemplate As String

strFileName = Environ("Temp") & "\rep_temp.txt"

If Len(Dir(strFileName)) > 0 Then
Kill strFileName
End If
DoCmd.OutputTo acOutputReport, strReportName, acFormatTXT, strFileName

intFile = FreeFile
Open strFileName For Input As #intFile
Do While Not EOF(intFile)
Line Input #intFile, strLine
strTemplate = strTemplate & vbCrLf & strLine
Loop
Close #intFile

DoCmd.SendObject acSendNoObject, "", acFormatTXT, strTo, , , strSubject,
strBody & strTemplate

End Sub

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

"Lateral" <Lateral@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:505A982E-DEBA-490A-95CB-77C0D711FD9A@xxxxxxxxxxxxxxxx
Hi Alex

Thanks for the link but unfortunately it does not work...can you please
check and reissue the link?

Thanks a lot.

Regards
Greg

"Alex Dybenko" wrote:

Hi,
here a sample code:
http://maug.pointltd.com/access/Queries/TipDetail.asp?TipID=71

--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

"Lateral" <Lateral@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AF41D044-08FB-4F3A-9851-D0D740E0E6A3@xxxxxxxxxxxxxxxx
Hi guys

I am using the Issue database template from Microsoft and are making
some
enhancements.

I want to be able to generate an email and have the body of the email
contain the report data.

I can create attachments ok but I really want to be able to "merge" the
report into the body of the actual email.

Any help is appreciated.

Regards
Greg




.



Relevant Pages

  • Re: Emailing report data
    ... Best regards, ... "Alex Dybenko" wrote: ... Public Sub olSendRpt(strTo As String, strBody As String, strSubject As ... Dim strFileName As String, intFile As Integer, strLine As String, ...
    (microsoft.public.access.modulesdaovba)
  • Sending report as HTML Body of e-mail
    ... report in the body of an e-mail. ... Public Sub olSendRpt(strTo As String, strBody As String, strSubject As ... Dim strFileName As String, intFile As Integer, strLine As String, ... strTemplate As String ...
    (microsoft.public.access.formscoding)
  • Re: Emailing report data
    ... "Alex Dybenko" wrote: ... Public Sub olSendRpt(strTo As String, strBody As String, strSubject As ... Dim strFileName As String, intFile As Integer, strLine As String, ... strTemplate As String ...
    (microsoft.public.access.modulesdaovba)
  • Re: Help with my code
    ... "Alex Dybenko" wrote: ... I did not get an error, but it will not display all records. ... Dim strSQL As String, strJPL1 As String, strSubject As String, ... & vbCrLf & vbCrLf ...
    (microsoft.public.access.modulesdaovba)
  • Re: Help with my code
    ... mean that I paste on the previous query or another new line. ... "Alex Dybenko" wrote: ... Dim strSQL As String, strJPL1 As String, strSubject As String, ... & vbCrLf & vbCrLf ...
    (microsoft.public.access.modulesdaovba)