Strangeway
Programmer
Hi guys,
I borrowed the following code from a post by Remou (thanks!) which attaches an RTF document to an email as the message body:
Sub RTFBody()
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Dim fs, f
Dim RTFBody, strTo
Dim MyApp As New Outlook.Application
Dim MyItem As Outlook.MailItem
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.opentextfile("D:\Data\wg400\My Documents\20068B.rtf", ForReading)
RTFBody = f.readall
f.Close
Set MyItem = MyApp.CreateItem(olMailItem)
With MyItem
.To = "blah@blahblah.com"
.Subject = "txtSubjectLine"
.Body = RTFBody
End With
MyItem.Display
End Sub
It works like a charm except that it doesn't display the formatting of the Word document, and instead spits out line after line of the information like this:
"{\rtf1\ansi\ansicpg1252\landscape\paperh12240\paperw15840\margl360\margr360\margt360\margb360\psz1{\colortbl\red0\green0\blue0;\red255\green255\blue255;\red31\green0 etc. etc. etc."
Does anyone know how to resolve this issue?
As usual, all help is greatly appreciated!
Cheers.
"I'm not a programmer... I just say that to meet chicks.
I borrowed the following code from a post by Remou (thanks!) which attaches an RTF document to an email as the message body:
Sub RTFBody()
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Dim fs, f
Dim RTFBody, strTo
Dim MyApp As New Outlook.Application
Dim MyItem As Outlook.MailItem
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.opentextfile("D:\Data\wg400\My Documents\20068B.rtf", ForReading)
RTFBody = f.readall
f.Close
Set MyItem = MyApp.CreateItem(olMailItem)
With MyItem
.To = "blah@blahblah.com"
.Subject = "txtSubjectLine"
.Body = RTFBody
End With
MyItem.Display
End Sub
It works like a charm except that it doesn't display the formatting of the Word document, and instead spits out line after line of the information like this:
"{\rtf1\ansi\ansicpg1252\landscape\paperh12240\paperw15840\margl360\margr360\margt360\margb360\psz1{\colortbl\red0\green0\blue0;\red255\green255\blue255;\red31\green0 etc. etc. etc."
Does anyone know how to resolve this issue?
As usual, all help is greatly appreciated!
Cheers.
"I'm not a programmer... I just say that to meet chicks.