Dim body As NotesRichTextItem Set body = doc.GetFirstItem ( "Body" ) If ( richTextFieldEmpty ( body ) ) Then If ( uidoc Is Nothing ) Then Else Msgbox "Please enter the Content", MB_OK + MB_ICONSTOP, "Field Contains Incorrect Value" Call uidoc.GoToField ( "Body" ) End If validateRequiredFields = False Exit Function Else Print "Rich Text Field not empty" End If
Function richTextFieldEmpty ( rti As NotesRichTextItem ) As Boolean Dim rtNav As NotesRichTextNavigator On Error Goto errorHandler richTextFieldEmpty = False If ( rti Is Nothing ) Then Print "Rich Text Field does not exist" richTextFieldEmpty = True Exit Function End If Set rtNav = rti.CreateNavigator If ( rtNav.FindFirstElement ( RTELEM_TYPE_TABLE ) ) Then Print "Table found in rich text field" Exit Function End If If ( rtNav.FindFirstElement ( RTELEM_TYPE_TEXTRUN ) ) Then Print "Text run found in rich text field" Exit Function End If If ( rtNav.FindFirstElement ( RTELEM_TYPE_TEXTPARAGRAPH ) ) Then Print "Text paragraph found in rich text field" Exit Function End If If ( rtNav.FindFirstElement ( RTELEM_TYPE_DOCLINK ) ) Then Print "Doclink found in rich text field" Exit Function End If If ( rtNav.FindFirstElement ( RTELEM_TYPE_SECTION ) ) Then Print "Section found in rich text field" Exit Function End If If ( rtNav.FindFirstElement ( RTELEM_TYPE_TABLECELL ) ) Then Print "Table cell found in rich text field" Exit Function End If If ( rtNav.FindFirstElement ( RTELEM_TYPE_FILEATTACHMENT ) ) Then Print "Attachment found in rich text field" Exit Function End If If ( rtNav.FindFirstElement ( RTELEM_TYPE_OLE ) ) Then Print "OLE object found in rich text field" Exit Function End If richTextFieldEmpty = True endOfCode: Exit Function errorHandler: displayError ( Getthreadinfo (1) ) Error Err, Error$ '-- Throw Error back to invoking code Resume endOfCode End Function
1. Eric Numeric03/28/2010 12:41:49 PM
How to validate for a Horizontal Rule in Rich Text? I'd like to find a way to capture all text up to the next Horizontal Rule found in a rich text field. Any ideas?
2. Domino05/21/2010 06:17:40 AM
Very good tip.
3. Jim Romaine04/12/2011 12:54:42 PM
Thanks for the tip!
4. Nitesh07/14/2011 05:43:11 AM
Hey about validation rich text in UI document?
Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | |||