We have a database that our users access through the Notes client. The database allows users to configure home “pages”. Each “page” actually consists of a very simple document with a rich-text field on it. In the rich-text field, the users can place tables, graphics, clickable hotspots, links and so on.
One user wants to insert a link to a web page, to make a cartoon appear. For example;
If I place this link directly onto the FORM using the Designer client, and mark it as passthru HTML, it works as expected - when the document opens in the Notes client, Dilbert greets the users.
If the same link is placed into the rich-text FIELD, again marked as pass-thru HTML, it does not work. The user sees just the text of the HTML.
The users want freedom to design their own pages in any way they choose, so I can’t add passthru HTML to the form design itself. It cramps their style.
Does anyone know a way to make passthru HTML work in this case? That is, when it’s contained in a field on a form, not placed on the form itself? It’s for a NOTES client not a web browser.
Thank you for your comments. Unfortunately I am trying to make this work in the Notes client not in a web browser.
Maybe it’s reasonable that the Notes client does not render HTML in fields, while it does render HTML that’s part of the form design. Probably if you type HTML into a field, you want it to be viewed as HTML and not have the Notes client try to interpret it or render it.
Nonetheless, I think if you deliberately mark the text in a field as passthru HTML (as the Notes client allows you to do), you are saying that you DO want it rendered, and it’s puzzling that the Notes client takes no notice of this.
OK. I think I didn’t saw that you want it to be done in notes client.
I tried this, and it works.
Create a rich text field: HTML_Code
Create a rich text field: Body, tick the “Set Content as HTML or MIME”
Create a button, calling an agent.
Below is the agent’s code:
Sub Initialize
Dim session As New notessession
Dim db As notesdatabase
Dim doc As notesdocument
Dim body As notesmimeentity
Dim stream As notesstream
Set db = session.CurrentDatabase
Set doc = session.DocumentContext
session.ConvertMime = False
Set stream = session.CreateStream
Call stream.writetext (doc.GetFirstItem ("HTML_Code").text)
Set body = doc.GetMIMEEntity
Call body.SetContentFromText (stream, "text/html", 1)
Call doc.ComputeWithForm (True,False)
Call doc.Save (True,False)
session.ConvertMime = True
End Sub
You will see the HTML taking form in the Body field.