Determine if the delivered date of the last document is greater than 30 minutes ago

I’m trying to determine if the last document in an Inbox was delivered more than 30 minutes ago. I am having issues with setting this up. Can anyone advise?

Sub Initialize

Dim session As New NotesSession

Dim db As NotesDatabase

Dim collection As NotesDocumentCollection

Dim doc As NotesDocument

Dim Test1 As Double

Dim Test2 As Double





Set db = session.CurrentDatabase

Set collection = db.UnprocessedDocuments

Set doc = collection.GetlastDocument()



Test1=24*60*Cdbl(Now)

Test2=24*60*Cdbl(doc.DeliveredDate(0))



If Test1-Test2>30 Then Print True Else Print False

End Sub

Any help is always appreciated.

Melissa

Subject: Determine if the delivered date of the last document is greater than 30 minutes ago

I would start by building a view, which has the documents ordered by date/hour. Make sure the most recent document comes first, which is descending on date/hour I believe.

‘getfirsdocument’ in that view and compare it’s date/hour of arrival with the current date.

Subject: RE: Determine if the delivered date of the last document is greater than 30 minutes ago

I need some help with comparing the date/hour of the document. I’m getting type mismatches with the time and calculations.

Subject: Determine if the delivered date of the last document is greater than 30 minutes ago

You can use the NotesDateTime class.Use the TimeDifference method. Output is in seconds - you can read more in the Designer Help.