report as rtf attachment

arkres

Registered User.
Local time
Today, 09:52
Joined
Sep 26, 2001
Messages
62
Hi,

I have a module in my A2K database for Outlook functions. I have a report based on a query. I would like to be able to view the report, push a button and have the report first: convert to an rtf file, and then insert itself in the created MailItem. Can someone give me a clue?

Public Function Welcome()


Dim db As Database

Dim recprog As Recordset
Dim appol As New Outlook.Application
Dim appmess As MailItem
Dim strletterOne As String

Set db = CurrentDb
Set recprog = db.OpenRecordset("BookingSheetQuery")

Dim appwd As New Word.Application
Dim appdoc As Word.Document

strletterOne = "Dear " & recprog("Dear:") & ", " & _
vbCrLf & vbCrLf & _
"We have contacted your facilitator and have arranged to schedule your program as you requested. etc "
Set appmess = appol.CreateItem(olMailItem)
With appmess

.To = recprog("ParticipantEMail")
.Subject = "Your Cross-Cultural Training Program"
.Body = strletterOne
.Display

End With



End Function

Much appreciated!!!
 
Have you tried SendObject function.
 
Hi there. Yes, I tried SendObject, but I can't seem to get it to attach the report to the existing Outlook message. I think it might be a matter of code placement. SendObject creates the RTF and opens a new mail message. I think I need a vacation.......we all probably do!!!!
 
Code:
DoCmd.SendObject acSendReport, "ReportNameHere", acFormatRTF, "EmailAddressHere", "ccHere", "BccHere", "EmailSubjectHere", "EmailMessageBodyHere", False, " "
 
roland_access said:
Code:
DoCmd.SendObject acSendReport, "ReportNameHere", acFormatRTF, "EmailAddressHere", "ccHere", "BccHere", "EmailSubjectHere", "EmailMessageBodyHere", False, " "


Thanks very much!!
 

Users who are viewing this thread

Back
Top Bottom