but it's not working....
can any one help me....
here is my code:
Private Sub ListFiles(strPath As String, Optional Extention As String)
Dim File As String
If Right$(strPath, 1) <> "\" Then strPath = strPath & "\"
If Trim$(Extention) = "" Then
Extention = "*.*"
ElseIf Left$(Extention, 2) <> "*." Then
Extention = "*." & Extention
End If
File = Dir$(strPath & Extention)
Do While Len(File)
List1.AddItem File
File = Dir$
Loop
End Sub
Private Sub Command1_Click()
Dim theList As Long
Dim textToSearch As String
textToSearch = LCase(Text1.Text)
For theList = 0 To List1.ListCount - 1
theListText = LCase(List1.List(theList))
If theListText = textToSearch Then List1.Text = textToSearch
Next
If textToSearch = List1.Text Then '[B]the part here is not working[/B]
rtftext.loadfile List1.Index
End If
End Sub
Private Sub Form_Load()
ListFiles "C:\", "txt"
End Sub
the code here list the file.txt from a directory
then the search button finds the file on that is typed on the textbox
and "i want to load the content of the file.txt but i couldn't do it"
i don't know how to load the file.....plz help me!!!!


Sign In
Create Account


Back to top









