par bug00 » 31 Mars 2003 à 07:52
C'est un code trés propre mais l'essentielle y est : Dim db As NotesDatabase Dim view As NotesView Dim nav As NotesViewNavigator Dim entry As NotesViewEntry Dim countoffice As Integer Dim count2000 As Integer Dim countxp As Integer Dim count97 As Integer Dim officetype As Variant Dim countnoffice As Integer Dim msg As String Set db = New NotesDatabase( "Serveurdomino", "PostesMicro.nsf" ) Set view = db.GetView( "Office" ) Set nav = view.CreateViewNavFromCategory( "Office" ) Set entry = nav.GetFirstDocument countoffice = 0 count2000 = 0 countxp = 0 count97 = 0 countnoffice = 0 ' begin counting documents ' stop when there are no more documents Do Until entry Is Nothing countoffice = countoffice + 1 officetype = entry.ColumnValues(3) Select Case officetype Case "office 2000" count2000 = count2000+1 Case "office xp" countxp = countxp + 1 Case "office 97" count97 = count97 + 1 Case Else End Select Set entry = nav.GetNextDocument( entry ) Loop Set nav = view.CreateViewNavFromCategory( "Sans Office" ) Set entry = nav.GetFirstDocument Do Until entry Is Nothing countnoffice = countnoffice + 1 Set entry = nav.GetNextDocument( entry ) Loop Messagebox "Nombre d'office = " & countoffice & Chr(13) & Chr(13) & _ " Nombre d'office xp = " & countxp & Chr(13)& _ " Nombre d'office 2000 = " & count2000 & Chr(13)&_ " Nombre d'office 97 = " & count97 & Chr(13)& Chr (13) &_ "Nombre d'utilisateur sans office = " & countnoffice & Chr(13),,"Statistiques"et laisse tombé le "couplage" entre le lotusscript et les formules, ca ne fonctionne pas terrible je trouve.