작성 날짜가 두 날짜 (시작과 끝) 사이 인 모든 문서를 가져 오려고합니다.NotesViewNavigator가있는보기에서 두 날짜 사이에 문서 검색
가끔 버그가 있습니다. 마지막 카테고리가 15/01/2015 일 경우, 2015 년 1 월 15 일에 시작 날짜 또는 종료 날짜를 넣을 때 : "객체 변수가 설정되지 않았습니다". 나는 이해하지 못한다.
내 모든 문서에서 볼 수 있습니다. 분류 된보기입니다. 나는이보기에 loog를 notesviewnavigator로보고 싶습니다.
내 문서의 작성 날짜가 시작일 또는 최종 날짜와 같거나 그 시점과 같으면이 문서를 최종 모음집에 넣습니다. 내 프로그램이 끝나면 폴더에 모든 것을 넣고보기를 표시합니다.
이
내 코드입니다 : 내가 단계 내가 그것을 이해하지만 동안의 끝에서 한 단계를 수행 할 때Function RechercheDocParDate(dateDebut As String, dateFin As String, nomFolder1 As String, nomFolder2 As String, nomFolder3 As String, nomVue As String, numColonne As Integer) As Integer
' recherche les documents d'une vue en fonction de dates passées en paramètre pour les créer dans un folder privé
Dim vueRech As NotesView
Dim j As Integer
Dim collecEntryFinal As NotesViewEntryCollection
Dim entry As NotesViewEntry
Dim colonDate As String
Dim nbDocTrouve As Integer
Dim flag As Boolean
Dim nav As NotesViewNavigator
Dim dbb As NotesDatabase
Dim Session As New NotesSession
Set dbb = session.CurrentDatabase
' Récupération des données de la vue
Set vueRech = dbb.GetView(nomVue)
Call vueRech.Refresh
nbDocTrouve = 0
' a revoir : initialisation de la création d'entry
' création d'une collection d'entry (moins consommateur car le document n'est pas ouvert)
Set collecEntryFinal = vueRech.GetAllEntriesByKey("_gdfgdfg")
j = 1
flag = True
' création d'un navigateur de catégorie d'entry
Set nav = vueRech.CreateViewNav
Set entry = nav.GetFirst
' si on n'est pas rendu à la fin de la vue (penser aux hors catégories)
While ((Not (entry Is Nothing)) And (flag = True))
' si c'est bien une categorie
If entry.IsCategory Then
'récupère la colonne de date
colonDate = entry.ColumnValues(numColonne)
If (colonDate >= dateDebut) Then
If (colonDate > dateFin) Then
flag = False
Else
Set entry = nav.GetNext(entry)
's'il y a des documents
While ((Not (entry Is Nothing)) And (entry.IsDocument))
'recupere les documents de la catégorie
Call collecEntryFinal.AddEntry(entry)
nbDocTrouve = nbDocTrouve + 1
Set entry = nav.GetNext(entry)
'//ALERT
' it finds the documents but in the end of the list of document it crashes here
'//ALERT
Wend
Set entry = nav.GetPrev(entry)
End If
End If
Else
'recupere les documents hors catégorie
While ((Not (entry Is Nothing)) And (entry.IsDocument))
Call collecEntryFinal.AddEntry(entry)
nbDocTrouve = nbDocTrouve + 1
Set entry = nav.GetNext(entry)
Wend
End If
Set entry = nav.GetNextCategory(entry)
Wend
'on crée le dossier privé pour l'utilisateur
'si on trouve des résultats ils sont ajoutés dans le folder
If Not Isempty(collecEntryFinal) Then
If nomFolder1 <> "" Then
collecEntryFinal.PutAllInFolder(nomFolder1)
End If
If nomFolder2 <> "" Then
collecEntryFinal.PutAllInFolder(nomFolder2)
End If
If nomFolder3 <> "" Then
collecEntryFinal.PutAllInFolder(nomFolder3)
End If
End If
Call vueRech.Refresh
RechercheDocParDate = nbDocTrouve
End Function
확인
'object variable not set'오류 메시지를 생성하는 코드 줄은? –
동안의 wend는 문서를 찾았지만 기지에 다른 문서가 없다면 (베이스의 끝이다), 충돌이 난다. 나는 다른 날짜를 테스트하면 좋다. 그 날)... – sissi49