Rich Text Programmability for Notes R5 Applications
by André Guirard

Topic(s): Application Development, LotusScript
This article includes downloadable files -- see below.

from THE VIEW, May/June 2000

Notes R5 provides several new ways for an application to work with rich text, particularly in the front end where, until now, developers have not been able to do much with rich text. In this article, you’ll learn how to dynamically create a table in a Notes application document that a user is editing, invoke LotusScript from imported HTML buttons, include hot links and images via HTML import, and verify that the end user has entered a value in a rich text field. You’ll also see how to use new back-end features to generate an e-mail notification with special paragraph formatting and hot text links to Notes documents. These techniques are also demonstrated in a sample database that you can download from THE VIEW’s Web site.

File downloads associated with this article:
This sample application runs in a Notes client. It demonstrates new LotusScript features for rich text, which are used to dynamically create a table in a Notes application document, invoke LotusScript from imported HTML, verify that the end user has entered a value in a rich text field, and generate e-mail notifications that include hot links to Notes documents and special paragraph formatting.

NOTE CORRECTION: Some versions of Notes have a bug that causes a crash when line items are edited multiple times on the Order form in the original sample database posted with this article. This revised sample database contains a workaround for the error. The code to edit the order line items, and the code to create and import the HTML file, have been split into two separate LotusScript agents. This method isn't as efficient as putting all the code on the form, but it has the advantage of not crashing.

It appears that LotusScript has some internal memory corruption caused by the commands to open a dialog box, erase the old table, and import the new table, but only if they're all in the same script. By splitting them into two scripts, LotusScript gets to pause midway through the process, clear all the memory it was using, and start with a clean slate.

The error has been reported to Lotus Development..


r5RTFSample.nsf