Hallo,
mit Interesse habe ich das Posting "[Views&Folder] Folder References - In welchem Ordner ist das jeweilige Dokument?" gelesen und umgesetzt.
Doch leider habe ich das Problem, dass folgendes Script nur bei Hauptdokumenten funktioniert. Gibt es eventuell auch eine Möglichkeit das Script entprechend abzuändern, dass bei Antwortdokumenten der Ordner des Hauptdokuments angezeigt wird?
Hier das Script:
Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim szReference As String
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set doc = collection.GetFirstDocument
Forall r In doc.FolderReferences
If r = "" Then Goto Empty
szReference = r & Chr(10) & szReference
End Forall
While Not (doc Is Nothing)
Msgbox "Folder References: " & Chr(10) & Chr(10) &szReference, 64, db.title
Set doc = collection.GetNextDocument(doc) 'Nächstes Dokument
Wend
Exit Sub
Empty:
Msgbox "No References in this document....", 64, db.title
End Sub
Viele Grüsse
Peter
Habe es wie folgt gelöst:
Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim szReference As String
Dim szDocID As String
Dim parent As NotesDocument
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set doc = collection.GetFirstDocument
While Not (doc Is Nothing)
If Not doc.IsResponse Then
Forall r In doc.FolderReferences
If r = "" Then Goto Empty
szReference = r & Chr(10) & szReference
End Forall
End If
If doc.IsResponse Then
szDocId = doc.ParentDocumentUNID
Set parent = db.GetDocumentByUNID(szDocID )
Forall r In parent.FolderReferences
If r = "" Then Goto Empty
szReference = r & Chr(10) & szReference
End Forall
End If
Msgbox "Folder References: " & Chr(10) & Chr(10) &szReference, 64, db.title
Set doc = collection.GetNextDocument(doc) 'Nächstes Dokument
Wend
Exit Sub
Empty:
Msgbox "No References in this document....", 64, db.title
End Sub
Gruß
Peter