Правильно ли я делаю (взял из разных тем форума) и доработал:
--
На открытие в папке (shared, private on first use):
Sub Queryopen(Source As Notesuiview, Continue As Variant)
Dim ws As New NotesUIWorkspace
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Set db = session.CurrentDatabase
Set collection=db.AllDocuments
Call collection.RemoveAllFromFolder( "myfolder")
End Sub
--
В папке вызываю форму поиска "SeachForm", в которой есть поля выбора формы, автора, статуса, ну и интервал дат.:
Sub Click(Source As Button)
Dim ws As New NotesUIWorkspace
Dim session As New NotesSession
Dim db As NotesDatabase
Dim searchDoc As NotesDocument
Dim dc As NotesDocumentCollection
Dim find As String
Set searchDoc = New NotesDocument(session.CurrentDatabase)
If ws.DialogBox("SearchForm", True, True, False, False, False, False, "Search", searchDoc , True) Then
find = {(Form = "} + Cstr(searchDoc.FormSelect(0)) + {")}
find = find + {&(Author = "} + Cstr(searchDoc.cAuthor(0)) + {")}
find = find + {&(Status = "} + Cstr(searchDoc.cStatus(0)) + {")}
find = find + {&@Created >= @TextToTime("} + searchDoc.Date1(0) + {")}
find = find + {&(@Created <= @TextToTime("} + searchDoc.Date2(0) + {"))}
Set dc = session.CurrentDatabase.Search(find, Nothing, 0)
Messagebox dc.count
Call dc.PutAllInFolder("myfolder", False)
Call ws.ViewRefresh
End If
End Sub
--
Когда только начинал писать скриптик без указания формы вылетело: "Notes error: To move a response document to a folder that shows response hierarchy you need to move the topmost parent of the response (asd)". Почему скрипт не отработал без указания формы главного документа? Как я понял надо перенести самый верхний уровень документов, чтобы перенеслись и респонсы? Есть ли формула для переноса сразу всех документов включая респонсы?