Das Notes Forum

Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: Don Pasquale am 17.02.03 - 12:19:11

Titel: Angewählte Dokumente einer Ansicht
Beitrag 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

Titel: Re:Angewaählte Dokumente einer Ansicht
Beitrag von: Till_21 am 17.02.03 - 12:22:16
hol dir die docs ueber "uiview.documents" nicht ueber "db.unprocesseddocuments"

gruss
Titel: Re:Angewaählte Dokumente einer Ansicht
Beitrag von: Axel am 17.02.03 - 12:36:45
@Till_21

Das gibt aber alle Dokumente und nicht nur die markierten.


Axel




Titel: Re:Angewählte Dokumente einer Ansicht
Beitrag von: Don Pasquale am 17.02.03 - 12:47:31
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
Titel: Re:Angewählte Dokumente einer Ansicht
Beitrag von: forrest g am 17.02.03 - 13:00:31
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$ )
Titel: Re:Angewählte Dokumente einer Ansicht
Beitrag von: Don Pasquale am 17.02.03 - 13:26:31
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
Titel: Re:Angewählte Dokumente einer Ansicht
Beitrag von: forrest g am 17.02.03 - 13:42:48
hallo don pasquale,

mhhhm...
ich dachte die collection wäre leer?

wollte dir damit nen lösungsansatz für das problem liefern...

tschö
Titel: Re:Angewaählte Dokumente einer Ansicht
Beitrag von: Till_21 am 17.02.03 - 13:46:41
@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
Titel: Re:Angewählte Dokumente einer Ansicht
Beitrag von: ata am 17.02.03 - 14:47:56
... 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