Dim sText As String
Dim intFileNum As Integer
If Form3.Text1.Text = "" Then
With CD1
.DialogTitle = "Open Name File"
.Filter = "All Supported Types|*.usr;*.txt;*.dat|"
.ShowOpen
intFileNum = FreeFile
On Error Resume Next
Open .FileName For Input As #intFileNum
While Not EOF(intFileNum)
Input #intFileNum, sText$
If sText$ = "" Then
Exit Sub
Else
List1.AddItem sText$
DoEvents
End If
Wend
Close #intFileNum
End With
Else
If Check1.Value = vbChecked Then
With CD1
.DialogTitle = "Open Name File"
.Filter = "All Supported Types|*.usr;*.txt;*.dat|"
.ShowOpen
intFileNum = FreeFile
On Error Resume Next
Open .FileName For Input As #intFileNum
While Not EOF(intFileNum)
Input #intFileNum, sText$
If sText$ = "" Then
Exit Sub
Else
List1.AddItem sText$ [color="#FF00FF"]& "_"[/color]
DoEvents
End If
Wend
Close #intFileNum
End With
End If
End If
Label1.Caption = "Word's: " & List1.ListCount
End Sub