?
Solved

vb .net search for text in a Word document

Posted on 2009-12-27
3
Medium Priority
?
334 Views
Last Modified: 2013-11-26
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.
0
Comment
Question by:wardo123
  • 2
3 Comments
 

Author Comment

by:wardo123
ID: 26135975
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
0
 

Accepted Solution

by:
wardo123 earned 0 total points
ID: 26167772
I found the solution using this page, in thier example they use the footer, but have comments on how to access the header as well.
http://www.dreamincode.net/forums/showtopic60975.htm
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month17 days, 2 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question