LOTUSSCRIPT /COM/OLE のクラス
例:Search メソッド
1 次のスクリプトは @IsResponseDoc を使って、2000 年 5 月 1 日以降に作成か変更されたすべての返答文書のコレクションを取得します。
Dim db As New NotesDatabase("Katmandu","somedocs.nsf")
Dim collection As NotesDocumentCollection
Dim dateTime As New NotesDateTime(_
Cstr(Datenumber(2000, 5, 1)))
Set collection = db.Search("@IsResponseDoc",dateTime,0)
2 次のスクリプトは、@IsResponseDoc を使って、データベース内のすべての返答文書のコレクションを取得します。
Dim db As New NotesDatabase("Katmandu","somedocs.nsf")
Dim collection As NotesDocumentCollection
Set collection = db.Search("@IsResponseDoc",Nothing,0)
3 次のスクリプトは、プロジェクトの参加者に、データベースからプロジェクト文書をメールで送信して期限を確認させます。各文書の ReminderDate アイテムに確認の文書を送付する日時を指定します。Search メソッドは ReminderDate アイテムに今日の日付が設定されているすべてのプロジェクト文書を取得し、メールで送信します。そして、ReminderDate アイテムの日付を 1 週間後の日付に更新します。
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim dateTime As New NotesDateTime(_
Cstr(Datenumber(2000, 5, 1)))
Dim nextDateTime As NotesDateTime
searchFormula$ = "Form = ""Project"" & _
ReminderDate = @Today"
Set db = session.CurrentDatabase
Set collection = db.Search(searchFormula$,dateTime,0)
Set doc = collection.GetFirstDocument()
Set nextDateTime = New NotesDateTime("Today")
Call nextDateTime.AdjustDay(7)
While Not(doc Is Nothing)
Call doc.Send( True )
Call doc.ReplaceItemValue("ReminderDate", _
nextDateTime.LSLocalTime )
Call doc.Save( True, False )
Set doc = collection.GetNextDocument(doc)
Wend
End Sub
関連項目
Search メソッド
用語集
ヘルプに対するフィードバック
ヘルプの使い方
ヘルプを開く
用語集
ヘルプに対するフィードバック
ヘルプの使い方
ヘルプを開く