Subject: Regarding Richtextitem on embedded object
I wrote the following, it’s not perfect as the “size” seems to be a magic value… I haven’t found anything to tell me what an empty rich text field size would be - seems to change from field to field (I’m guessing the name of it or something)
Function IsRichTextFieldEmpty(doc As NotesDocument, fieldName As String) As Boolean
. . Const MagicSizeValue = 250
. . Dim tmp As Variant
. . Dim blank As Boolean
. .
. . blank = False
. . If doc.HasItem(fieldName) Then
. . . . tmp = doc.GetItemValue(fieldName)
. . . . If Isempty(tmp) Then
. . . . . . blank = True
. . . . Else
. . . . . . If Trim(tmp(0)) = “” Then
. . . . . . . . blank = True
. . . . . . End If
. . . . . .
. . . . . . ’ Looks blank but is there an object?
. . . . . . If blank Then
. . . . . . . . Dim itm As NotesRichTextItem
. . . . . . . .
. . . . . . . . Set itm = doc.GetFirstItem(fieldName)
. . . . . . . . If itm.valuelength > MagicSizeValue Then
. . . . . . . . . . blank=False
. . . . . . . . Else
. . . . . . . . . . ’ One last attemp
. . . . . . . . . . tmp = itm.EmbeddedObjects
. . . . . . . . . . If Not Isempty(tmp) Then
. . . . . . . . . . . . blank=False
. . . . . . . . . . End If
. . . . . . . . End If
. . . . . . End If. .
. . . . End If
. . . .
. . Else
. . . . blank = True
. . End If
. .
. . IsRichTextFieldEmpty = blank
End Function