email access 97

  • Thread starter Marcel Broersen
  • Start date
M

Marcel Broersen

I want to send the result of an Access 97 query in an
Email, and not as an attachment but in the body of the
email

who helps me out???



regards,

Marcel Broersen
 
A

Alex Dybenko

here a sample how to send report, so if you make report of your query and
try this sub

Public Sub olSendRpt(strTo As String, strBody As String, strSubject As
String, strReport As String)
'To run it:
'olSendRpt "(e-mail address removed)", "Sending report", "subject", "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, strReport, 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,
strTemplate

End Sub

HTH
 

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

Top