Hi There,
I am trying to mark some documents as current if they are in between the dates on the configuration documents. I am getting a type mismatch, can anyone help ?
Code :
Sub Initialize
Dim s As New NotesSession
Dim db As notesDatabase
Dim CDoc As NotesDocument
Dim doc As NotesDocument
Dim DT As NotesDateTime
Dim StartDT As NotesDateTime
Dim EndDT As NotesDateTime
Dim v As NotesView
Dim strPath As String
Dim DocColl As NotesDocumentCollection
Set db = s.CurrentDatabase
Set v = db.GetView("ImageLkp")
Set CollV = db.GetView("ImgLkps")
'Set today
Set DT = New NotesDateTime("Today")
Set CDoc = v.GetDocumentByKey("Yes") ' Get the current image path
Set DocColl = CollV.GetAllDocumentsByKey("Index")
Set doc = DocColl.GetFirstDocument
Do Until doc Is Nothing
Set StartDT = New NotesDateTime(Cdat(doc.DT_From(0)))
Set EndDT = New NotesDateTime(Cdat(doc.DT_To(0)))
If DT > StartDT And DT < EndDT Then
doc.Used = "Yes"
CDoc.Used = ""
Call doc.Save(True,True)
Call CDoc.Save(True,True)
Exit Sub
End If
Set doc = DocColl.GetNextDocument(doc)
Loop
End Sub
Getting the error on the IF DT > StartDT line.
Thanks for any help
F1H