include template when sending mail

Nicksten

New member
Local time
Today, 11:52
Joined
Jan 15, 2007
Messages
3
hi guys

I am using this code to send a report as the body of an email. I have included a path for the template I wish to use - but - it doesnt work. Can anyone help me please? What would be better if I could include the whole report, with images etc :)
_____________________________________________________________

Private Sub AppDeclined_Click()
Const ForReading = 1, ForWriting = 2, ForAppending = 3

Dim fs, f
Dim RTFBody, strTo
Dim MyApp As New Outlook.Application
Dim MyItem As Outlook.MailItem

DoCmd.OutputTo acOutputReport, "application_declined", acFormatTXT, "Report1.txt", , "C:\Program Files\Microsoft Office\Stationery\1033\TECHTOOL.HTM"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("Report1.txt", ForReading)
RTFBody = f.ReadAll
f.Close

Set MyItem = MyApp.CreateItem(olMailItem)
With MyItem
.To = "<email address>"
.Subject = "<my subject>"
.body = RTFBody
End With
MyItem.Send
End Sub
________________________


Thanx for the help.
Nicksten
 

Users who are viewing this thread

Back
Top Bottom