Lotus Notes / Domino Sonstiges > Tipps und Tricks

Inbox Recover

(1/3) > >>

meichhorner:
Hallo,

einige von euch hatten ja schon mal Probleme das nach irgendwelchen Aktionen die Inbox leer war und diese Dokumente nun nur noch in der Ansicht Alle Dokumente vorhanden waren.

Hier ein Script das Abhilfe schaffen sollte (habe es selber noch nicht ausprobiert) ;)


--- Code: ---Sub Click (Source As Button)

'**********************************************************************
' This script builds an array of documents that are included in a
'folder. It then compares each document in the All Documents view to
'each document in the array. If it finds one, it breaks out and
'continues onto the next document. If it reaches the end of the array,
'then it hasn't found a match and the document is moved to the Inbox
'folder.
'**********************************************************************

Dim s As New notessession
Dim db As notesdatabase
Dim fDoc As NotesDocument ' Document in folder
Dim ad As notesview ' All Documents view
Dim aDoc As notesdocument ' document in All Docs view
Dim fUNID() As String ' array of UNID's of docs in folders
Dim i As Integer ' UNID array index
Dim deldate As notesitem
Dim Chair1 As notesitem

i =0
Set db = s.CurrentDatabase

' Build UNID array by looping through folders, then their documents
Forall view In db.views
     If view.IsFolder And Not view.Name=("($All)") Then
           Set fDoc = view.GetFirstDocument
           While Not fDoc Is Nothing
                 Redim Preserve fUNID(i)
                 fUNID(i) = fDoc.UniversalID
                 i=i+1
                 Set fDoc = view.GetNextDocument(fDoc)
           Wend
     End If
End Forall

' Loop through docs in the All Documents view and compare UNIDs to each
doc
in the array
Set ad = db.GetView("($All)")
Set aDoc = ad.GetFirstDocument
While Not aDoc Is Nothing
     i = 0
     Do While i <= Ubound(fUNID)
           If fUNID(i) = aDoc.UniversalID Then
                 Exit Do
           End If
           i = i + 1
     Loop
     Set deldate = adoc.getfirstitem("delivereddate")
     Set Chair1 = adoc.getfirstitem("CHAIR")
     If i > Ubound(fUNID) And Not deldate Is Nothing And Chair1 Is
Nothing Then
           Call adoc.PutInFolder( "($Inbox)")

      End If
     Set aDoc = ad.GetNextDocument(adoc)
Wend
End Sub


--- Ende Code ---

Glombi:
Von der Logik sieht es ok aus. Wegen der Performance: Das würde ich dann mal vor dem Mittagessen anstoßen und ein 5-Gang-Menü einnehmen.

Danke für das Script - könnte mal ganz nützlich sein.

Andreas

meichhorner:
So, hab es jetzt gerade mal getestet ;D

MailDB - 300 MB
Dokumente gesamt 555 davon in der Inbox 105

Script-Laufzeit : ca. 5 Minuten



Semeaphoros:
... abgesehen davon, das ist ja schliesslich ein Flickwerkzeug, ist doch egal, wenn das Ding ein 5GangMenu braucht, lieber das als ein 5-Gang-Auto, das lässt sich nicht aufessen :-)

Glombi:
Die Performance hängt nicht nur von der Anzahl der Dokumente ab , sondern auch von der Anzahl der Folder in der Datenbank.

Auf Deiner Maschine braucht das Script ca. 0,55 Sek pro Dok.
Für ein 5-Gang-Menü braucht man schätzungsweise 2 Std = 7200 Sek.

Also, wenn ich ca. 13000 Dokumente habe, klappts auch mit dem Essen  ;)

Maaaahlzeit!
Andreas

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln