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.
- 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.
- 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.
- 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
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.