I want to add JPEG files to forms (via LotusScript) as a picture, not as an attachment.
LotusScript does not provide a way to insert pictures into Rich Text directly. There are a couple of options, however.
- If you store each picture in a Rich Text field in a separate Notes document in advance, you can find the document in a view and use AppendRTItem to add the picture into another NotesRichTextItem that you're creating.
- If using the front end is an option, you can use NotesUIDocument.Import to bring in a JPEG file into a Rich Text field of a document that's open in edit mode.
- In Notes 6, if the file is available to users on a disk when they're using the application (e.g., in a file share), then you can use pass-thru HTML in the Notes client to display the image.
- In a Domino Web application, you can create the files as attachments and use pass-thru HTML to display them by calculating a URL as follows: (document URL)/$FILE/filename. Use @AttachmentNames to get the filename. You will also need to use a hidden section around the Rich Text field that contains the attachments, since hide formulas don't work with Rich Text fields (each Rich Text paragraph has its own hide formula that overrides what is defined on the form).
- You can use the Notes API or a third-party tool such as the Midas Rich Text LSX from GeniiSoft.com to create whatever Rich Text you want.
This was first published in October 2003