LOTUSSCRIPT /COM/OLE のクラス


例:LockProvisional メソッド
次のビューアクションは、「Guys」グループのすべてのメンバーに対し、現在の文書をロックしようとします。文書がまだロックされていない場合、またはロックされているが有効なユーザーが Guys のメンバーに含まれている場合は、ロックは成功します。暫定ロックが設定されます。

%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.IsDocumentLockingEnabled Then
   Print "Document locking not enabled"
   Exit Sub
 End If
 
 REM Get selected document
 Dim dc As NotesDocumentCollection
 Dim doc As NotesDocument
 Set dc = db.UnprocessedDocuments
 Set doc = dc.GetFirstDocument
 
 REM Lock the document
 REM Not locked if return is False or error is raised
 On Error Goto errh
 If doc.LockProvisional("Guys") Then
   Print "Document locked"
 Else
   Print "Document NOT locked"
 End If
 Exit Sub
errh:
 If Err() = lsERR_NOTES_LOCKED Then
   Print "Document NOT locked"
 Else
   Messagebox "Error " & Err() & ":" & Error(),, "Error"
 End If
 Exit Sub
End Sub

関連項目