DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   VB.NET (http://www.daniweb.com/forums/forum58.html)
-   -   how to search a word in Micro Soft documents(Word, Excel,Powerpoint)-urgent? (http://www.daniweb.com/forums/thread179871.html)

itshibu Mar 4th, 2009 8:08 am
how to search a word in Micro Soft documents(Word, Excel,Powerpoint)-urgent?
 
Dear Friends,

I would like to search a word or phrase in microsoft documents. I want to search text portion only. f possible line by line. so i can exit the reading while I find that word.

I tried with
OpenFileDialog1.ShowDialog()

        Dim ioFile As New StreamReader(OpenFileDialog1.FileName)
        Dim ioLine As String ' Going to hold one line at a time
        Dim ioLines As String ' Going to hold whole file
        ioLine = ioFile.ReadLine
        ioLines = ioLine
        While Not ioLine = ""
            ioLine = ioFile.ReadLine
            ioLines = ioLines & vbCrLf & ioLine
        End While
        TextBox1.Text = ioLines

But unfortunately some files are not reading properly.


pls help


All times are GMT -4. The time now is 7:49 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC