Remplir un folder

Remplir un folder

Messagepar Michael DELIQUE » 05 Sep 2007 à 09:27

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
Cordialement

Michael (SMS-Phobique)
----------------------------
"La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi."
Albert EINSTEIN
Avatar de l’utilisateur
Michael DELIQUE
Administrateur
Administrateur
 
Message(s) : 12183
Inscrit(e) le : 16 Déc 2004 à 10:36
Localisation : Paris/Cergy

Retour vers Traitement sur les vues