Page 1 sur 1

Problème de classement de mails dans courrier en arrivée

MessagePublié: 28 Jan 2011 à 10:27
par agnessop
Bonjour

J'ai un souci avec une bal. Les documents sont bien dans "tous documents" mais je n'ai plus rien dans courrier en arrivée. On m'a envoyé le code suivant pour pouvoir les reclasser. Quand je créé mon agent et que je mets le code dans "initialize", tout le code se met en rouge et je n'arrive pas à trouver d'erreur. Quelqu'un peutil m'aider ? (je ne connais pas trop le code notes)

Sub Initialize
       
        Dim currentSession As NotesSession
        Dim currentDb As NotesDatabase
        Dim inboxFolder As NotesView
        Dim mailsCollection As NotesDocumentCollection
        Dim mailsInFolders As NotesDocumentCollection
        Dim EntriesMailsClasses As NotesViewEntryCollection
        Dim loopDoc As NotesDocument
        Dim iDoc As Integer
        Dim querySearch As String
        Dim msgTxt As String
       
       
        msgTxt = "=== Début du reclassement à " & Time$  & " ==="
        querySearch = {SELECT @IsUnavailable( $Conflict ) & IsMailStationery != 1 & @Length( @Text(DeliveredDate) ) > 0 & Form != "Group" & Form != "Person" & Form != "Appointment"}
       
        Set currentSession = New NotesSession
        Set currentDb = currentSession.CurrentDatabase
        Set inboxFolder = currentDb.GetView( "($Inbox)" )
        Set mailsCollection = currentDb.Search( querySearch, Nothing, 0 )
        inboxFolder.AutoUpdate = False
       
        Print {Classement de } & mailsCollection.Count & { mails dans le dossier ($Inbox)}
        Call mailsCollection.PutAllInFolder( "($Inbox)", False )
       
        Set mailsInFolders = currentDb.Search( "1=2", Nothing, 0 )
        Forall loopView In currentDb.Views
                If ( loopView.IsFolder ) And ( Instr( 1, loopView.Name, "(", 5 ) = 0 ) Then
                        loopView.AutoUpdate = False
                       
                        Set loopDoc = loopView.GetFirstDocument()
                        Do While Not loopDoc Is Nothing
                                If ( loopDoc.IsValid ) And ( Not loopDoc.IsDeleted ) Then
                                        On Error Resume Next
                                        Call mailsInFolders.AddDocument( loopDoc )
                                        If ( Err > 0 ) Then Err = 0
                                        On Error Goto 0
                                        iDoc = iDoc + 1
                                End If
                                If ( iDoc Mod 128 = 0 ) Then Print {Traitement du document } & iDoc
                               
                                Set loopDoc = loopView.GetNextDocument( loopDoc )
                        Loop
                       
                        loopView.AutoUpdate = True
                End If
        End Forall
        Print {Retrait de } & mailsInFolders.Count & { mails du dossier ($Inbox)}
        Call mailsInFolders.RemoveAllFromFolder( "($Inbox)" )
        inboxFolder.AutoUpdate = True
        Set mailsInFolders = Nothing
       
        Print msgTxt & " === Fin du reclassement à " & Time$  & " ==="
       
End Sub



Merci d'avance !!!

Agnès

MessagePublié: 28 Jan 2011 à 11:33
par Michel Nico
aucun problème de mon coté : lors du collage du code dans un agent il ne pose pas de problème.

MessagePublié: 28 Jan 2011 à 11:38
par agnessop
Effectivement, le copier coller à partir d'ici fonctionne. contrairement au copie colle d'un mail !!! Merci beaucoup !