Hi, i am facing a problem… pls help me with a solution… am more than appreciate thank you…
i have a richtext field, and that field is mandatory… when attachment is put in the field… it cannot be submit… cos only when text is entered in the field then can submit… i check the field by doing this…
Function validatert(doc ,uidoc,bodystr) As Boolean Dim hasInfo As String
Dim i As Integer
Dim rtnav As NotesRichTextNavigator
Dim elemType(1 To 8) As Long
Dim tempDoc As NotesDocument
Call uidoc.refresh(True)
Set doc = uidoc.document
Set body = doc.GetFirstItem(bodystr)
If body Is Nothing Then
validatert = False
Exit Function
End If
Set rtnav = body.CreateNavigator
Dim rtrange As NotesRichTextRange
Set rtrange = body.CreateRange
elemType(1) = RTELEM_TYPE_DOCLINK
elemType(2) = RTELEM_TYPE_FILEATTACHMENT
elemType(3) = RTELEM_TYPE_OLE
elemType(4) = RTELEM_TYPE_SECTION
elemType(5) = RTELEM_TYPE_TABLE
elemType(6) = RTELEM_TYPE_TABLECELL
elemType(7) = RTELEM_TYPE_TEXTPARAGRAPH
elemType(8) = RTELEM_TYPE_TEXTRUN
For i = 1 To 8 Step 1
If rtnav.FindFirstElement(elemType(i)) Then
hasinfo = "Yes"
Exit For
Else
hasinfo = "No"
End If
Next
If hasinfo = "No" Then
validatert = False
Exit Function
Else
validatert = True
End If