Page 1 sur 1

Remplir un folder

MessagePublié: 05 Sep 2007 à 09:27
par Michael DELIQUE
Permet de passer un document ou une collection dans un folder

Code : Tout sélectionner
Public Sub FolderAdd(wFolder As String,wdoc As NotesDocument,wCOllection As NotesDocumentCOllection)
   
   'Déclaration Variable
   Dim vwFolder As NotesView
   Dim Session as NotesSession
        Dim db as NotesDatabase
   
   On Error Goto ErreurHandle
   
   Set Session = New NotesSession
   Set DB = Session.CUrrentdatabase
   
   If Trim(wFolder) = "" Then
      Error 9999,"Variable ''wFolder'' non renseigné"
      Exit Sub
   Else
      Set vwFolder = db.GetView(wFolder)
      If vwFolder Is Nothing Then
         Error 9999,"Folder '' "+ wFolder+" '' Introuvable"
         Exit Sub
      End If
   End If
   
   If wDoc Is Nothing Then
      If wCollection Is Nothing Then
         Exit Sub
      Elseif wCollection.count = 0 Then
         Exit Sub
      End If
   End If
   
   If Not wDoc Is Nothing Then
      Call wDoc.PutInFolder( wFolder )
   End If
   
   If Not wCollection Is Nothing Then
      If wCollection.count > 0 Then
         Call wCollection.PutAllInFolder( wFolder )
      End If
   End If   
   
   Call vwFolder.refresh
   
   Set vwFolder = Nothing
   
   Exit Sub
ErreurHandle:
   Msgbox "("+Cstr(Getthreadinfo (1))+" Call by "+Cstr(Getthreadinfo(10))+")"+Chr(10)+"Erreur " + Str(Err) + " : "+Chr(10) + Cstr(Error)+". "+Chr(10)+"Ligne N° "+Cstr(Erl),16," ERREUR !"   
   Set vwFolder = Nothing
   Exit Sub
End Sub