VB.NET search text in doc file

Last post 07-11-2008 1:48 PM by ArminStockner. 1 replies.

Sort Posts:

  • VB.NET search text in doc file

    07-11-2008, 9:20 AM
    • Loading...
    • poloxy
    • Joined on 07-10-2007, 7:28 PM
    • Posts 56
    How can I search text in doc file ?
  • Re: VB.NET search text in doc file

    07-11-2008, 1:48 PM
    • Loading...
    • ArminStockner
    • Joined on 09-19-2006, 6:18 AM
    • Germany, Bavaria
    • Posts 251

     HI,

    1. Dim sReader As New StreamReader("C:\myfile.doc")
    2. Dim text As String = sReader.ReadToEnd()
    3. sReader.Close
    4.  
    5. If text.Contains("searchvalue") Then
    6.       'do something
    7. End If

     

    Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
Page 1 of 1 (2 items)
Microsoft Communities
Page view counter