Passthru HTML inside rich text field. Can it work in Notes client?

Hi there,

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.

We have Notes 6.5.2

Thank you in advance for any tips, Ian Jones

Subject: Passthru HTML inside rich text field. Can it work in Notes client?

I thought, just by appending “[” before the HTML code and “]” will work?

Subject: Passthru HTML inside rich text field. Using square brackets

Thanks Rusyinni,

Did this work for you? It did not work for me when I tried it.

Subject: RE: Passthru HTML inside rich text field. Using square brackets

It worked for me. Check that The field’s text is not Passed Through HTML.

Try pasting this "html>

Try this

]
at your Rich Text field, and preview in web browser.
It should work

Rgds
Rus

Subject: Notes client, not web browser

Hi Rusyinni,

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.

Oh well, I guess I’m stuck.

Best wishes, Ian Jones

Subject: RE: Notes client, not web browser

OK. I think I didn’t saw that you want it to be done in notes client.

I tried this, and it works.

  1. Create a rich text field: HTML_Code

  2. Create a rich text field: Body, tick the “Set Content as HTML or MIME”

  3. 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.

Best rgds

Rus

Subject: RE: Notes client, not web browser

Thanks Rus, your post is really helpful!

I had not encountered these Notes MIME methods before, so you have given me something very useful to pursue!

Best wishes, Ian