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!

Rich Text into Text

Status
Not open for further replies.

DoctorGonzo

Programmer
Jan 23, 2004
48
GB
Hi folks,

I have a field on my form called BODYTEXT, which is a text field.

THis field contains a formula that gets text, number, date and Rich text fields.

An agent runs to compose memo and appends this text field into the memo.body.

It works fine UNTIL I put the rich text fields in there.

This is the field contents :

"New Holiday Feedback Submitted by " + Username +
@NewLine + @NewLine +"Holiday Company Travelled with : " + FB_HolComp +
@NewLine + @NewLine +"Departure Date : " + FB_DepartDate +
@NewLine + @NewLine +"The User submitted the following comments: " +
@NewLine + @NewLine +"On the booking process: " + FB_BookProcessComments +
@NewLine + @NewLine +"On Airports/flights: " + FB_AirportsFlightsComments +
@NewLine + @NewLine +"Please do not reply to this email message. It has been automatically generated by the intranet."

The comments fields are the Rich text ones. Here is the agent :

Sub Initialize
Dim s As New notessession
Dim db As notesdatabase
Dim doc As notesdocument, cdoc As notesdocument
Dim rt As notesrichtextitem
Dim message As String

Set db = s.currentdatabase
Set doc = New notesdocument(db)
Set cdoc = s.documentcontext
message=cdoc.message(0)

doc.SendTo = cdoc.Recipients
doc.form = "Memo"
doc.subject = "New holiday feedback from " & cdoc.Username(0)

Set rt = New notesrichtextitem(doc,"Body")

' import the contents of the message field on the Document into the BODY of the memo
Call rt.appendtext(bodytext)

Call doc.send(False)
Print "mail sent"

End Sub

Can anyone advise me? I've scoured about but not sure really what to search on... tried RICH TEXT, @TEXT etc.

Thanks,

Gonzo
 
Or the same thing in LS : getformattedtext

Used like this :
Call rt.appendtext(bodytext.getformattedtext)

Pascal.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top