Das Notes Forum
Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: Don Pasquale am 17.02.03 - 12:19:11
-
Hallo Leute,
ich möchte die angewählten Dokumente einer Ansicht mehrmals bearbeite, deswegen möchte ich sie in eine Collection packen.
Leider ist folgende Collection immer leer.
Wer weiss wieso?
Ciao
Don Pasquale
Sub Queryaddtofolder(Source As Notesuiview, Target As Variant, Continue As Variant)
Dim uiws As New NotesUIWorkspace
Dim uiview As NotesUIView
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Set uidb = uiws.CurrentDatabase
Set uiview = uiws.CurrentView
Set db = session.CurrentDatabase
Set dc = db.UnprocessedDocuments ' ...alle markierten Dokumente
Set doc = dc.GetFirstDocument 'das erste Dokument
Print ("Anzahl " & dc.Count)
While Not doc Is Nothing
Messagebox ( doc.e4fld_Identnummer(0) & " ist " & doc.e4fld_Ausgecheckt(0) )
Set doc = dc.GetNextDocument( doc ) 'das nächste Dokument
Wend
-
hol dir die docs ueber "uiview.documents" nicht ueber "db.unprocesseddocuments"
gruss
-
@Till_21
Das gibt aber alle Dokumente und nicht nur die markierten.
Axel
-
Ich hab es jetzt hiermit probiert,
das scheint erfolg zu haben
For k = 1 To Source.Documents.Count
Set doc = Source.Documents.GetNthDocument(j)
' mach irgendwas mit Docuemtn
Next k
-
hallo don pasquale,
...aus der hilfe...
This method is valid only for agent or view action scripts and may be invoked only on NotesDatabase objects obtained from the CurrentDatabase property in NotesSession. In scripts that are not a part of an agent or view action, this method returns a NotesDocumentCollection with zero documents. When invoked on a NotesDatabase object that was not obtained from the CurrentDatabase property, this method raises an error.
...du must hier über notessession ran und hast keinen view gewählt...
also vorher:
tschö
Set notesView = db.GetView( viewName$ )
-
Hallo Forrest,
aber ich befinde mich doch im
QueryAddToFolder Ereignis einer Ansicht.
Ist das nicht genau hierfür gedacht. Ich bekomme
ja schliesslich genau die gewünschte Anzahl an Dokumenten
Ciao
Don Pascquale
-
hallo don pasquale,
mhhhm...
ich dachte die collection wäre leer?
wollte dir damit nen lösungsansatz für das problem liefern...
tschö
-
@Till_21
Das gibt aber alle Dokumente und nicht nur die markierten.
Hi Axel,
war mir nicht mehr ganz sicher, habe deshalb nochmal in der hilfe geguckt ->
Read-only. All the documents that the current NotesUIView event is working on.
also fuer donpasquale genau das richtige...
gruss
-
... ich würde die db vor der Initialisierung der dc mit
If db.IsOpen Then
Set dc = db.UnprocessedDocuments
'...
End If
... überprüfen, ob ich die DB öffnen kann...
ata