Domino 9 und frühere Versionen > Entwicklung

Alle Dokumente mit DeliveredDate "gestern oder früher" (Script)

(1/3) > >>

HRaq:
Hallo Leute,

ich möchte den Wert des Feldes "DeliveredDate" auslesen, und dann alle Dokumente, die nicht von heute sind, archivieren.


Dim session As New NotesSession
   Dim db As NotesDatabase
   Dim arcdb As New NotesDatabase("" , "archiv.nsf")
   Dim dc As NotesDocumentCollection
   Dim doc As NotesDocument
   Dim wert As Variant
   Dim nextdoc As notesdocument
   
   Set db = session.CurrentDatabase
   Set dc = db.AllDocuments
   Set doc = dc.GetFirstDocument
   
   Do Until doc Is Nothing
      Set nextdoc = dc.getnextdocument(doc)
     
      wert = doc.GetItemValue("DeliveredDate")
      If wert(0)  ="?" Then
         Call doc.CopyToDatabase(arcdb)               
             Call Doc.Remove( True )     
      End If
      Set doc = nextdoc
   Loop

Da wo das Fragezeichen steht, hänge ich. Könnt Ihr einem nichtwissenden Admin helfen?
Danke...

koehlerbv:
<> Today.
Das wars schon.

Bernhard

HRaq:
Bernhard,
ich wußte, auf dich ist Verlass.  :)
Danke

koehlerbv:
 :)

HRaq:
Moin Leute,
leider funktioniert es doch nicht so, wie ich erhofft hatte. Er nimmt auch die Docs von heute mit und löscht sie dann in der QuellDB. Habe ich einen Fehler in der Syntax?

If wert(0)  <> today Then

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln