Rich Text Field - Backend validation for pasted pictures

I want to validate RTF for its value at the backend in an agent that runs from an action button. I want to check if RTF is empty or not. By empty I mean it does not contain ANY type of data especially pasted pictures.

I have already searched forum but could not find aything that could solve my problem.

Your effort to help is highly appreciated.

Subject: Rich Text Field - Backend validation for pasted pictures

Thankyou all BUT …

I want to use Lotus Script. I don’t want to edit or delete RTF. I want to perform some action if RTF is empty. I tried the “RichTextNavigator” but it didn’t detect pasted picture.

Any more ideas are welcomed.

Subject: Try this…

Dim rt As NotesRichTextItemSet rt = doc.GetFirstItem(“YourRTField”)

If rt.Text = “” And rt.ValueLength < 120 Then

'In all probability the field is empty - you may have to play with the 120 value

End If

Subject: RE: Try this…

Thanks Bill.

This sounds the best solution as long as length of empty RTF stays consistent.

Subject: It is fairly, depends on the default formatting of the field.

Subject: Rich Text Field - Backend validation for pasted pictures

You have two basic choices for backend validation of this sort. You can either dump the contents to DXL and see whether there is any content you don’t want, bearing in mind that you will have some content even with an empty rich text field, or you can use a third party product such as our Midas Rich Text LSX, which has a ContainsSomething property which is set to True if there is anything other than an empty rich text field.

Subject: RE: Rich Text Field - Backend validation for pasted pictures

Alternately, to make sure the field does not contain ANY data, delete it from the form.

Subject: *LOL

Subject: RichTextNavigator

Shouldn’t it be a lot simpler (or cheaper :wink: to use a NotesRichTextNavigator for this kind of validation?

A RichTextNavigator should be able to find all types of elements, not just the ones that you can actually manipulate using the class.

cheers,

Bram

Subject: *It would be better, but the NotesRichTextNavigator will only work after it is saved.