%INCLUDE "lsxbeerr.lss" Sub Click(Source As Button) Dim session As New NotesSession Dim db As NotesDatabase Set db = session.CurrentDatabase REM Exit if locking is not enabled If Not db.IsDesignLockingEnabled Then Print "Design locking not enabled" Exit Sub End If REM Get form Dim form As NotesForm Set form = db.GetForm("Main Document") REM Lock the document REM Not locked if return is False or error is raised On Error Goto errh If form.LockProvisional("Guys") Then Print "Form locked - " & form.Name Else Print "Form NOT locked - " & form.Name End If Exit Sub errh: If Err() = lsERR_NOTES_LOCKED Then Print "Form NOT locked - " & form.Name Else Messagebox "Error " & Err() & ": " & Error(),, "Error" End If Exit Sub End Sub
See Also