Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim fs, f, ts
colonne = 1
ligne = 1
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile("\\wpa00030\d$\WebSphere\PortalServer\log\_LogActivite\euralis_log_activite_2012_4.log")
Set ts = f.OpenAsTextStream(ForReading, TristateUseDefault)
On Error GoTo fin
I = 1
For n = 1 To 20
MsgBox ts.ReadLine 'Dans le cas où les lignes suivantes sont commentés m'affiche les ligne de mon fichier une par une jusqu'à la ligne 20, sinon, des lignes sont sautés.
' If InStr(UCase(ts.readline), "AGRICOLE") <> 0 Then
' 'MsgBox ts.readline
' agricole = agricole + 1
' End If
' If InStr(UCase(ts.readline), "SEMENCES") Then
' semence = semence + 1
' End If
Next n