Lotus Notes FAQ Visit Our Sponsor!

How do you import HTML so it's displayed properly in the Notes client?


From Steve Castledine:

You can import the HTML as a MIME entity like so:
'Put your text/html content from browser editor output into temporary field - for this example field "contenttmp"
'Get handle to tmp field
Dim tmpitem As notesrichtextitem
Set tmpitem=doc.GetFirstItem("contenttmp")


' Get hold of the output from tmp field
Dim mime As NotesMIMEEntity
Dim stream As NotesStream
Set stream = session.CreateStream
Call stream.WriteText(tmpitem.GetFormattedText(False,32767))

'Remove original rich text output if it is called "content"
Call doc.RemoveItem("content" )

'Stream in your text/html - richtext field will accept it properly and when you view in notes it will be formatted
Set mime = doc.CreateMIMEEntity("content")

Call mime.SetContentFromText (stream, "text/html;charset=
UTF-8
", ENC_NONE)


Applies to Notes Versions: 7
Last Modified: October 11, 2006