Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do you check if an RTF field is empty? This interesting workaround comes from [email] Alan Keele.

0
Posted

How do you check if an RTF field is empty? This interesting workaround comes from [email] Alan Keele.

0

Function IsRTFNull(rtfield As String) As Integer ‘This function tests a Rich Text field to see whether or not it is null. It returns TRUE if the field is null, and ‘returns FALSE if the field is not null. It works even if the rich text field contains a file attachment, ‘doclink, or OLE object but does not contain any text. On Error Goto Errhandle Dim workspace As New NotesUIWorkspace Dim uidoc As NotesUIDocument Set uidoc = workspace.CurrentDocument ‘Store the name of the field that currently has focus. Note: if this function is being called from a form button, ‘currentfield will be null (because the button has the focus, and not a field). If this function is called ‘from an action button, and if the cursor is in a field, then currentfield will correctly store the name ‘of the field that has focus. currentfield = uidoc.CurrentField Call uidoc.GotoField(rtfield) Call uidoc.SelectAll ‘The next line will generate a 4407 error message if the Rich Text Field is null Call uidoc.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123