Bonjour,
Comment faire pour savoir si mon lotus est déjà ouvert ?
Du style :
if lotus.isopen = 1 then
msgbox "ouvert"
else
msgbox "fermé"
merci d'avance
Bonjour,
Comment faire pour savoir si mon lotus est déjà ouvert ?
Du style :
if lotus.isopen = 1 then
msgbox "ouvert"
else
msgbox "fermé"
merci d'avance
Inscrire dans un module access :
[VBA]
[VBA]
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 Function FileLocked(strFileName As String) As Boolean On Error Resume Next ' If the file is already opened by another process, ' and the specified type of access is not allowed, ' the Open operation fails and an error occurs. Open strFileName For Binary Access Read Write Lock Read Write As #1 Close #1 ' If an error occurs, the document is currently open. If Err.Number <> 0 Then ' Display the error number and description. 'MsgBox "Error #" & Str(Err.Number) & " - " & Err.Description FileLocked = True Err.Clear End If End Function
Dans la procédure d'appel :
[VBA]
[VBA]
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 Dim strFileName As String 'test du lotus si ouvert strFileName = "D:\Lotus\Notes\nlnotes.exe" If Not FileLocked(strFileName) Then MsgBox "Votre messagerie Lotus est fermé veuillez l'ouvrir" Exit Sub End If
Et ça marche !!!!
Partager