Ask the Expert

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.

This was first published in April 2003

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: