how i can check any text string in a doc file.the searchinh should be fast as i have to do other code if it found the string
kapil.goyal 0 Light Poster
Recommended Answers
Jump to PostAre you talking about a file on disk or loaded into a richtext or text box? The latter two can be done with the InStr function.
Unles you want to load the file into memory the first is a lot harder and slower to do.
Jump to PostSend each filename and string you want to find to this function. It will return true if the string is found and false if the string is not found.
Private Function CheckFile(ByVal FileName As String, ByVal strSearch As String) As Boolean Dim s As String = My.Computer.FileSystem.ReadAllText(FileName) …
Jump to PostI don't know about 100mb you might try it. If it doesn't work then you will have to do it as wavalker said:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If FindStringInFile("c:\test.txt", "gooder") Then MessageBox.Show("found") Else MessageBox.Show("not found") End If End Sub …
Jump to PostAh, then you must connect to the document using word document or convert the word doc to a text file.
I don't have Word so I can't tell you how to do it. Word has a way to search in its files (I think).
All 15 Replies
waynespangler 63 Posting Pro in Training
kapil.goyal 0 Light Poster
wavalker 0 Newbie Poster
kapil.goyal 0 Light Poster

iamthwee
waynespangler 63 Posting Pro in Training
kapil.goyal 0 Light Poster
kk_dj 0 Newbie Poster
waynespangler 63 Posting Pro in Training
kapil.goyal 0 Light Poster
waynespangler 63 Posting Pro in Training
kk_dj 0 Newbie Poster
waynespangler 63 Posting Pro in Training
kill_seth 0 Newbie Poster
vishalrane 0 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.