Determine whether the RTF domain is null before saving the document

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.