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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lotus Notes from VB, formatting body text

Status
Not open for further replies.

Fluoronator

Technical User
Jun 27, 2001
7
US
I have a VB program which sends Lotus Notes e-mail. The program works well except for one problem... When I try to send two lines of text in the body (separating them with vbCrLf) I get one line with an ugly little character representing the vbCrLf between the two lines of text. When I run the code below, the receiver of the e-mail sees something like this in the body of the message...

This is the first line of body text.||This is the second line of body text.

How can I format the body text to include carriage returns/line feeds and maybe even rich text with bold and colors?


***** Here is the complete code *****

Dim Session As New Domino.NotesSession
Dim Database As NotesDatabase
Dim Document As NotesDocument

Private Sub Command1_Click()
SendMail
End Sub


Private Sub SendMail()
Dim ServerName As Variant
Dim FileName As Variant
Dim SubjectText As String
Dim BodyText As String
Dim MailingList(2) As String
Dim PassWord As String
PassWord = "MyPassWord"
MailingList(0) = "TheFirstGuy"
MailingList(1) = "TheSecondGuy"
MailingList(2) = "TheThirdGuy"
SubjectText = "This is the subject text."
BodyText = "This is the first line of body text." & vbCrLf _
& "This is the second line of body text."
Call Session.Initialize(PassWord)
ServerName = Session.GetEnvironmentString("Mailserver", True)
FileName = Session.GetEnvironmentString("Mailfile", True)
Set Database = Session.GetDatabase(ServerName, FileName)
Set Document = Database.CreateDocument
With Document
.AppendItemValue "SendTo", MailingList
.AppendItemValue "Subject", SubjectText
.ReplaceItemValue "Body", BodyText
.Send False
End With
Unload Me
End
End Sub
 
Have you done a keyword search on the site? I tried EMAIL BODY and a few postings were there. One I noticed made remarks on carriage returns being a problem in email body. Might be a red herring but at least you can have a look while waiting. Regards
 
Have you tried vbNewLine, instead of vbcrlf?

[blues]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top