par Michael DELIQUE » 28 Août 2014 à 09:19
voici la fonction que j'utilise, en général je passe en paramètre le serveur ou est stocké la mailbox de l'utilisateur
- Code : Tout sélectionner
Public Function PingNotes (ByVal wServer As String) As Boolean
REM test si le server passé en parametre répond.
Dim DBNew As NotesDatabase
Dim DBdirectory As NotesDbDirectory
Dim Server As String
On Error GoTo CatchError
PingNotes = False
REM remove error to avoid issue.
Err = 0
If Trim(wServer) = "" Then
Exit function
End If
If Session Is Nothing Then
Set Session = New NotesSession
End If
Set DBdirectory = New NotesDbDirectory(Trim(Server))
On Error Resume Next
Set DBNew = DBdirectory.GetFirstDatabase(1247)
On Error GoTo CatchError
Set DBdirectory = Nothing
Set DBNew = Nothing
If Err <> 0 Then
PingNotes = False
Err = 0
Else
PingNotes = True
End If
Exit Function
CatchError:
If nbDisplayMsgBoxError = True Then
MsgBox "("+Cstr(GetThreadInfo (1))+" Call by "+Cstr(GetThreadInfo(10))+")"+Chr(10)+"Error " + CStr(Err) + " : "+Chr(10) + CStr(Error)+". "+Chr(10)+"Line # "+Cstr(Erl),16," ERROR !"
End If
PingNotes = False
Exit Function
End Function
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