Problem solve Get help with specific problems with your technologies, process and projects.

Is there a way to tell if a Rich Text field has an attachment or picture?

Hello, Andre. When working with Rich Text fields is there anyway you can run a validation script to check if there is something in the field? I know that you can check if the field has text, but what about checking if it has an attachment or a picture like a screen dump. Look forward to hearing from you.
These are really three separate questions.

  1. Can you tell whether the field is totally empty?
    Yes -- refer to Validating a Rich Text field before saving the document and Validating entry of a Rich Text field. These are slight variations on the same technique.

  2. Can you tell whether the field contains attachments?
    Yes -- refer to Domino Designer 6 Developer's Handbook, page 727, for an example that you can adapt. This example actually checks to make sure no attachments exceed a size limit, but it's easy enough to see how to tell whether there are no attachments. This example uses an On Error trap to detect the absence of attachments, but you can also use the expression "IsEmpty(rtf.EmbeddedObjects."

    Note: Embedded objects can contain either attachments or OLE objects, so if you want to make sure it's an attachment, not an object, you must check the type, as shown in the example.

  3. Can you tell whether the field contains images?
    Not easily. This sort of thing requires the Notes C API or third-party tools that employ the C API, such as Midas rich text LSX from Genii Software.

Dig Deeper on Domino Resources - Part 4

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/ community. These cheat ...