par Michael DELIQUE » 22 Juil 2005 à 17:47
- Code : Tout sélectionner
Function Reader_LS(wDoc As NotesDocument) As Variant
'Cette Fonction renvois laliste de toutes les personnes et rôles enregistrées comme lecteur du document
'déclaration Variable
Dim lstValue_STD List As String
Dim lstValue2_STD List As String
Dim i_STD As Integer
Dim nmReader_STD As NotesName
On Error Goto ErreurReader_LS
If wDoc Is Nothing Then
Error 9999,"wDoc is Nothing"
Exit Function
End If
i_sTD = 0
Forall Item In wDoc.Items
If Item.IsReaders = True Then
Forall Reader In Item.Values
If Trim(Reader) <> "" Then
Set nmReader_STD = New NotesName(Reader)
i_STD = 0
lstValue_STD(Cstr(nmReader_STD.canonical)) = Cstr(nmReader_STD.canonical)
Set nmReader_STD = Nothing
End If
End Forall
End If
End Forall
If i_STD = 0 Then
Erase lstValue_STD
lstValue_STD(0) = ""
Reader_LS = lstValue_STD
Erase lstValue_STD
Exit Function
End If
i_sTD = 0
Forall Value In lstValue_STD
lstValue2_STD(i_STD) = Value
i_STD = I_STD+1
End Forall
i_sTD = 0
Erase lstValue_STD
Reader_LS = lstValue2_STD
Erase lstValue2_STD
Exit Function
ErreurReader_LS:
Msgbox "(Reader_LS) Erreur " + Str(Err) + " : " + Cstr(Error)+Chr(10)+"Ligne N° "+Cstr(Erl),16, " ERREUR !"
Erase lstValue_STD
Erase lstValue2_STD
lstValue_STD(0) = ""
Reader_LS = lstValue_STD
Erase lstValue_STD
Exit Function
End Function