'curDoc - Текущий документ
'mainResolution - родительский документ самого верхнего уровня
'Изначально curDoc=mainresolution. Позже при рекурсивных вызовах curDoc меняется на 'дочерний документ. Так как процедура создавалась для резолюций, то и переменные 'называются соответственно childResolution, collResponseResolution и т.д.. Их можно изменить на 'другие названия
Sub SearchChildResolution(curDoc As NotesDocument, mainResolution As NotesDocument)
Dim childResolution As NotesDocument
Dim collResponseResolution As NotesDocumentCollection
Set collResponseResolution = curDoc.Responses
If collResponseResolution.Count=0 Then Exit Sub
Set childResolution = collResponseResolution.GetFirstDocument()
While Not childResolution Is Nothing
If childResolution.Responses.Count<>0 Then SearchChildResolution childResolution, mainResolution
' Здесь что-нибудь делаем с дочерним документом childResolution
Set childResolution = collResponseResolution.GetNextDocument(childResolution)
Wend
End Sub
'mainResolution - родительский документ самого верхнего уровня
'Изначально curDoc=mainresolution. Позже при рекурсивных вызовах curDoc меняется на 'дочерний документ. Так как процедура создавалась для резолюций, то и переменные 'называются соответственно childResolution, collResponseResolution и т.д.. Их можно изменить на 'другие названия
Sub SearchChildResolution(curDoc As NotesDocument, mainResolution As NotesDocument)
Dim childResolution As NotesDocument
Dim collResponseResolution As NotesDocumentCollection
Set collResponseResolution = curDoc.Responses
If collResponseResolution.Count=0 Then Exit Sub
Set childResolution = collResponseResolution.GetFirstDocument()
While Not childResolution Is Nothing
If childResolution.Responses.Count<>0 Then SearchChildResolution childResolution, mainResolution
' Здесь что-нибудь делаем с дочерним документом childResolution
Set childResolution = collResponseResolution.GetNextDocument(childResolution)
Wend
End Sub
Комментариев нет:
Отправить комментарий