Determine whether the RTF domain is null before saving the document
The RTF domain cannot be determined by the script before the document is saved. Therefore, the following Program Identify whether it is null.
You can Use The following function is used to determine whether to add the following in querysave: Code :
Flag = isrtfnull ("Your RTF domain name ")
If flag = true then
MessageBox "Enter content"
Continue = false
End if
Function isrtfnull (rtfield as string) as integer
On Error goto errhandle
Dim workspace as newNotes Uiworkspace
Dim uidoc as notesuidocument
Set uidoc = workspace. currentdocument
Currentfield = uidoc. currentfield
Call uidoc. gotofield (rtfield)
Call uidoc. selectall
Call uidoc. deselectall
If currentfield <> "" then
Call uidoc. gotofield (currentfield)
End if
Isrtfnull = false
Exit Function
Errhandle:
Select case err
Case 1, 4407
'The deselectall line generated an error message, indicating that the rich text field does not contain anything
If currentfield <> "" then
Call uidoc. gotofield (currentfield)
End if
Isrtfnull = true
Exit Function
Case else
'For any other error, force the same error to cause Lotus Script to do the error handling
Error err
End select
End Function