ChrisCalvert
Technical User
I am using the following bit of code graciously provided yesterday by scking (thanks again!) to import a .rtf file into a SendObject command. I want this to work as an email template.
---------------------------
Dim intFileNumber As Integer
Dim strTemplate As String
' Set up variable for the logfile
intFileNumber = FreeFile
Open LCase(strFilename) For Input As intFileNumber
Do While Not EOF(1) ' Loop until end of file.
Line Input #intFileNumber, TextLine
strTemplate = strTemplate & TextLine
DoEvents
Loop
Close intFileNumber
--------------------------------------
This code does work, but it does not preserve line breaks.
Is there anything I can alter to make the line breaks stay?
Or is there some other way to get mildly formatted text into this sendobject line:
DoCmd.SendObject acSendNoObject, , acFormatRTF, rst!Email, , , "Welcome to the test.", strTemplate, False
All help greatly appreciated,
Chris
---------------------------
Dim intFileNumber As Integer
Dim strTemplate As String
' Set up variable for the logfile
intFileNumber = FreeFile
Open LCase(strFilename) For Input As intFileNumber
Do While Not EOF(1) ' Loop until end of file.
Line Input #intFileNumber, TextLine
strTemplate = strTemplate & TextLine
DoEvents
Loop
Close intFileNumber
--------------------------------------
This code does work, but it does not preserve line breaks.
Is there anything I can alter to make the line breaks stay?
Or is there some other way to get mildly formatted text into this sendobject line:
DoCmd.SendObject acSendNoObject, , acFormatRTF, rst!Email, , , "Welcome to the test.", strTemplate, False
All help greatly appreciated,
Chris