|
-
Apr 8th, 2001, 09:51 PM
#1
Thread Starter
PowerPoster
This searches a text box. How can i get it to continue searching for the next words if it doesn't find a result?
Private Sub Command5_Click()
selct
copy
pste
Dim objSearch As Collection
Dim varSearch As Variant
Dim intPos As Integer
Set objSearch = New Collection
objSearch.Add "ccc"
objSearch.Add "aurora"
objSearch.Add "mining"
intPos = 0
For Each varSearch In objSearch
intPos = InStr(1, Text1.Text, varSearch)
If intPos > 0 Then
Open "C:\File.txt" For Append As #1
Print #1, varSearch & " was found in (" & _
Text1.Text & ") at position " & intPos
Close #1
Else
MsgBox "no results"
End If
Next
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|