LOTUSSCRIPT/COM/OLE CLASSES


Examples: TimeDifferenceDouble method
This agent checks to see if a document has been modified within the last seven days. If it hasn't, it mails a reminder memo to the document authors.

Sub Initialize
 Dim session As New NotesSession
 Dim db As NotesDatabase
 Dim doc As NotesDocument
 Dim newDoc As NotesDocument
 Dim weekDateTime As NotesDateTime
 Dim modifiedDateTime As NotesDateTime
 Set db = session.CurrentDatabase
 Set doc = session.DocumentContext
 Set weekDateTime = New NotesDateTime( "Today" )
 Set modifiedDateTime = New NotesDateTime( "" )
 Call weekDateTime.AdjustDay( -7 )  ' set to one week ago
 modifiedDateTime.LSLocalTime = doc.LastModified
 If weekDateTime.TimeDifferenceDouble( modifiedDateTime ) > 0  Then
   Set newDoc = New NotesDocument( db )
   newDoc.Form = "Memo"
   newDoc.Subject = _
   "Reminder: please update your project plan"
   Call newDoc.Send( False, doc.Authors )
 End If
End Sub

See Also