Some time ago I found a Querydocumentdelete script to remove children when deleting a parent.Now I need the same but for all descendants (the responses can go up to four levels deep).
If anyone has an idea, please post an example. Thanks in advance.
Sub Querydocumentdelete(Source As Notesuidatabase, Continue As Variant)
Dim delcol As NotesDocumentCollection
Dim respcol As NotesDocumentCollection
Dim deldoc As NotesDocument
Set delcol = Source.Documents
If delcol.Count > 0 Then
Set deldoc = delcol.GetFirstDocument
Do While Not(deldoc Is Nothing)
If deldoc.Responses.Count > 0 Then
Call deldoc.Responses.RemoveAll(Force)
End If
Set deldoc = delcol.GetNextDocument(deldoc)
Loop
End If
End Sub