Page 1 sur 1

Ouvrir la mailbox de l'utilisateur en cours

MessagePublié: 14 Juil 2005 à 11:11
par Michael DELIQUE
cette fonction fait appel à une autre fonction "DBExists_LS" qui est référencé dans les tips : http://forum.dominoarea.org/viewtopic.php?t=10711


Code : Tout sélectionner
Function DBOpenMailbox  (sgMailboxServer As integer) As NotesDatabase
   
   'Cette function Ouvre la boite mail
   'si sgSendBox =  true la fonction ouvre la boite mail du serveur en cours
   'si sgSendBox =  false la fonction ouvre la boite mail de l'utilisateur en cours

   'Déclaration Variable
   Dim Session As NotesSession
   Dim DB As Notesdatabase
   
   On Error Goto ErreurDBOpenMailbox
   
   'ouvre la boite mail
   If sgMailboxServer = False Then
      Set DBOpenMailbox = New NotesDatabase("","")
      If DBOpenMailbox.IsOpen = False Then
         Call DBOpenMailbox.Open("","")
      End If
      Call DBOpenMailbox.OpenMail
   Else      
      
      Set Session = New NotesSession
      Set DB = Session.CUrrentdatabase
      
      If Trim(DB.Server) = "" Then
         Set DBOpenMailbox = New NotesDatabase("","")
         If DBOpenMailbox.IsOpen = False Then
            Call DBOpenMailbox.Open("","")
         End If
         Call DBOpenMailbox.OpenMail
      Else
         Set DBOpenMailbox = New NotesDatabase(DB.Server,"mailbox.ntf")
         If DBOpenMailbox.IsOpen = False Then
            Call DBOpenMailbox.Open("","")
         End If
      End If
   End If
   
   If DBExists_LS(DBOpenMailbox) = False Then
      Set DBOpenMailbox = Nothing   
   End If
   
   Exit Function
ErreurDBOpenMailbox:
   Msgbox "(DBOpenMailbox) Erreur " + Str(Err) + " : "+Chr(10) + Cstr(Error)+". "+Chr(10)+"Ligne N° "+Cstr(Erl),16," ERREUR !"
   Set DBOpenMailbox = Nothing   
   Exit Function
End Function