Re: Emailing report data
- From: "Alex Dybenko" <alexdyb@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 2 Sep 2006 08:35:10 +0400
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
.
- Follow-Ups:
- Re: Emailing report data
- From: Lateral
- Re: Emailing report data
- Prev by Date: Re: Calling a UDF from a VB SQL statement
- Next by Date: Re: Emailing report data
- Previous by thread: Re: Emailing report data
- Next by thread: Re: Emailing report data
- Index(es):
Relevant Pages
|
Loading