wardo123
asked on
vb .net search for text in a Word document
I need to find a way to use VB 2008 express to open a Word document and find a text string and report back the following string. Following are the requirments.
1) The text string can be located in the Word body or in the header information, so the search needs to take place in both locations (I have a search that works for the body, but doesn't find info in the header)
2) I may search for "Exam Date:" and then I need to return the following date, so if the word document had Exam Date: 01/02/2009 then I should return 01/02/2009
3) For the code that I'm using that finds the string in the Body, I find that the program will crash if one of the word documents being looked at is already open. I only need read only data, so I would like to find a way around this.
1) The text string can be located in the Word body or in the header information, so the search needs to take place in both locations (I have a search that works for the body, but doesn't find info in the header)
2) I may search for "Exam Date:" and then I need to return the following date, so if the word document had Exam Date: 01/02/2009 then I should return 01/02/2009
3) For the code that I'm using that finds the string in the Body, I find that the program will crash if one of the word documents being looked at is already open. I only need read only data, so I would like to find a way around this.
ASKER
These exampes are for searching in the Word body, they won't find text that is in the Header in a Word Documet. I already have a working search for Word that will search the body, I need a search that will look in the body and the Header information.
Thanks
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.kdkeys.net/forums/thread/690.aspx