Keep access formatting in HTML

Pauldohert

Something in here
Local time
Yesterday, 21:52
Joined
Apr 6, 2004
Messages
2,101
.HTMLBody = .HTMLBody & "<LI>Resolution Description: " & Nz(Me!ResolutionDesc, "")


How can I keep the formatting of the ResolutionDesc memo field (ie Line Feeds and carriage returns) when I add it to an HTML email like this?


Thanks
 
Wrote beloe which seem on the way to solving it -



Code:
wStr = Nz(Me!ResolutionDesc, "")
'''go thru finding the carriage control
              wInt = 1
              Do Until wInt = 0
              wInt = InStr(1, wStr, Chr(13) & Chr(10))
              If wInt > 0 Then
                wToWrite = Left(wStr, wInt - 1)
              Else
                wToWrite = wStr
              End If
              wStr = Right(wStr, Len(wStr) - wInt - 1)
              .HTMLBody = .HTMLBody & wToWrite
              If wInt > 0 Then
                .HTMLBody = .HTMLBody & "<BR>"
              Else
                '.HTMLBody = .HTMLBody & wStr
              End If
              Loop
 
<grin>
wStr = Replace(Nz(Me!ResolutionDesc, ""), Chr(13) & Chr(10), "<BR>")

or maybe the following might also work

wStr = Replace(Nz(Me!ResolutionDesc, ""), vbcrlf, "<BR>")
 
That would seem to be a whole lot easier!:)
 
Since I was just replacing Chr(13) & Chr(10) with <BR> you would have thought it would have occured to me to use the Replace function.

Ta sorted - and far easier to use in a query!! Far better doing in one line what took me 20!
 

Users who are viewing this thread

Back
Top Bottom