Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email rtf file as Body rather than attachment

Status
Not open for further replies.

jasonphillipstx

Technical User
Dec 10, 2001
43
US
I have an rtf file created by using the docmd.output method and I want to send it as the body and not as an attachement. Is there a way to do this?
 
Hi
This seems to work, but I imagine there is a better way:
Code:
Sub RTFBody()
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Dim fs, f
Dim RTFBody
Dim MyApp As New Outlook.Application
Dim MyItem As Outlook.MailItem

'Using the FileSystemObject to read in RTF
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("C:\MyFile.rtf", ForReading)
RTFBody = f.readall
f.Close

'Create email
Set MyItem = MyApp.CreateItem(olMailItem)
With MyItem
    .To = "Contact@hotmail.com"
    .Subject = "Subject Line"
    .Body = RTFBody
End With

'Show email
MyItem.Display
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top