Domino 9 und frühere Versionen > ND7: Entwicklung

löschen von Dokumenten (MoveToTrash) selbst schreiben

<< < (4/5) > >>

Neuling_2k7:
Hi Sascha,

Das Skript funktioniert perfekt...
Die Dokumente verschwinden aus der Ansicht und tauchen im "Papierkorb" wieder auf...

Danke für die super Hilfe!!!

Gibt es eigentlich eine Möglichkeit zu verhindern, das Dokumente im Papierkorb geändert werden können? Dadurch würden sie nämlich wiederhergestellt...  :(

dirk_2909:

--- Code: ---  For i = 1 To Source.Documents.count
   Set doc = Source.Documents.GetNthDocument(i)
--- Ende Code ---

.. würde ich drauf verzichten. Ist ein PerformanceKiller ... (natürlich macht sich das nicht bei so wenigen Docs bemerkbar  ;) ).

Besser :

--- Code: ---set doc = coll.GetFirstDocument
While not doc is Nothing
    ...
    Set doc = coll.GetNextDocument( doc )
Wend
--- Ende Code ---

Neuling_2k7:

--- Zitat von: dirk_2909 am 27.11.07 - 09:54:03 ---Besser:

--- Code: ---set doc = coll.GetFirstDocument
While not doc is Nothing
    ...
    Set doc = coll.GetNextDocument( doc )
Wend
--- Ende Code ---

--- Ende Zitat ---

Hi,

das funktioniert bei mir leider nicht :(

folgendes Coding:

--- Code: ---Dim ws As New notesuiworkspace   
Dim coll As NotesDocumentCollection
Dim doc As notesdocument

Set coll=source.Documents
Set doc =coll.getfirstdocument

While Not doc Is Nothing
  doc.Remove(True)
  Set doc=coll.GetNextDocument(doc)
Wend


--- Ende Code ---

beim Löschen der Dokumente kommt dann folgende Fehlermeldung:

"Function requires a valid ADT argument"


F1F1F1 !!

Glombi:
So:

Dim ws As New notesuiworkspace   
Dim coll As NotesDocumentCollection   
Dim doc As notesdocument
Dim nextdoc As notesdocument

Set coll=source.Documents
Set doc =coll.getfirstdocument

While Not doc Is Nothing
set nextdoc = coll.getnextdocument(doc)
  doc.Remove(True)
  Set doc=nextdoc
Wend


P.s: Da war noch ein kleiner Fehler drin!

DAU-in:
set doc2 = coll.GetNextDocument(doc)
doc.remove(true)
set doc = doc2


wenn du das doc löscht, kann er das nächste dazu natürlich nicht mehr suchen

Navigation

[0] Themen-Index

[#] Nächste Seite

[*] Vorherige Sete

Zur normalen Ansicht wechseln