Domino 9 und frühere Versionen > ND6: Entwicklung
Problem mit collection.PutAllInFolder
Alexis:
@Semeaphoros,
das hätte mir eigentlich bekannt sein müssen, hab ich doch früher einmal mit hunderten von Foldern gearbeitet.
PutAllInFolder klappt übrigens genauso mit einer View!?
Für mich heisst das dann wohl alle Infos aus der Collection herausziehen und in neue Dokumente übertragen.
Alexis
Semeaphoros:
PutInFolder klappt nicht im Vieh-Stall. Die Auswahl der angezeigten Dokumente werden dort per Selection-Formula erstellt. Genau das ist der Unterschied zwischen Vieh und Folder: Vieh hat eine Selection - Formel, Folder ist eine freie Liste
Axel:
Ups, da hab ich doch glatt überlesen, dass es sich um verschiedene DBs handelt.
Dann geht's so natürlich nicht.
Axel
Alexis:
Hallo Forum,
es hat etwas gedauert, aber nun steht die gewünschte Lösung. Aus der PickListCollection lassen sich ja die einzelnen Dokumente adressieren und damit in die Zieldatenbank kopieren.
Hier der Code:
Sub Click(Source As Button)
' Function to select mail(s) from own mailbox, copy them to database, open View to set doclinks in case report
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim db As NotesDatabase
Dim uidb As NotesUIDatabase
Dim collection As NotesDocumentCollection
Dim copydoc As NotesDocument
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim item As NotesItem
Dim Mailserver As String
Dim Mailbox As String
Dim Mailview As String
Dim ID As String
Dim n As Integer
Set db = session.CurrentDatabase
Set uidoc = workspace.currentdocument
Set uidb = workspace.CurrentDatabase
ID=uidoc.FieldGetText("ID_Owner")
Mailserver="MAIL.COM/SRV/CCN"
Mailbox="MAIL" & ID & ".NSF"
Mailview="All by Date"
Set collection = workspace.PickListCollection(1, True, Mailserver,Mailbox,Mailview,"Mail Selection","Select relevant mails.")
Set doc = collection.GetFirstDocument
If collection.Count = 0 Then Goto label1
While Not ( doc Is Nothing )
Set copydoc = doc.CopyToDatabase( db )
Set doc = collection.GetNextDocument (doc)
Wend
Call uidb.OpenView("Mailview")
label1:
End Sub
Navigation
[0] Themen-Index
[*] Vorherige Sete
Zur normalen Ansicht wechseln