Manage Learn to apply best practices and optimize your operations.

Check Rtf Field Empty ( New One Which Works)

This function checks if a rich text field is empty.. there was one which was
posted earlier that checked if RTf.Valuelength is less than 96
but it did not work .. so a new code emerged!
Function IsrtfMT (doc As Notesdocument , FieldName As String) As Integer
' This function checks if a rich text field is empty

Dim mbdcount As Integer,plaintext As String
Dim rtitem As Variant
mbdcount =0 ' initialize
Set rtitem = doc.GetFirstItem(fieldname)
If ( rtitem.Type = RICHTEXT ) Then
plainText = rtitem.GetFormattedText( False, 0 ) ' render the
Rich item into text this gets all text values and ignores attachments/OLE
If Len(plaintext) < 1 Then

If Isarray(rtitem.EmbeddedObjects) Then
Forall o In rtitem.EmbeddedObjects ' loop through
array of embedded objects in the rich text item
mbdcount=mbdcount+1 ' there is at least
one emb object
End Forall
End If
End If
End If

If (mbdcount + Len(plaintext)) < 1 Then ' if there are no embedded
objects AND there is no text also
IsrtfMT=1 ' return flag to calling string RTF IS EMPTY
IsrtfMT=0 ' return flag to calling string RTF IS NOT EMPTY
End If

End Function

Dig Deeper on Domino Resources - Part 3

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.



  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...