Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Extract data from word doc to access database
Hello,
I am going to recieve about 250 word docs for a land survey project that are all the same format. The document will have 4 main sections, and then inside those, there will be details which will need to be captured (or harvested) and then saved as delimited text (or whatever will work best) for insertion into an access database. The problem is that most (80%) of the word doc is not formatted into any kind of tabular structure, at least from what I can tell. (As a side note - is there a way to check using something like reveal codes, as was in WP)? The only thing in common that each doc file has is that each file has the same keywords preceding the desired data value. MY QUESTION: Is there a way to have a VBA routine go through, and identify (which would be embedded in the VBA routine) keywords, and then based on that keyword, trigger a "copy" to action? There is always a consistent keyword preceding the desired data value. For example, here is a typical sentance (with the desired data value in {}, and the keyword in caps: EXAMPLE 1) That certain tract of land CONTAINING {105.899}acres, more or less... EXAMPLE 2) or another example in tabular format, separated by tabs (but shown here with commas and no separation); 1st line: *Surface,Mineral,Net 2nd line: Owner,*Interest,Interest,Mineral Acres 3rd line: John H. Smith,100%,50%,52.9495 * TO CLARIFY: The words Surface and Interest go together (like Surface Interest), just one on top of each other. Same for the words Mineral and Interest, as well as Net and Mineral Acres. In sum, I just want to know what are the ways that you can go into an existing word doc and extract the data that you need, that's all. I really don't know where to begin asking this, but if there is a better NG than this one, I'd apprieciate your direction on where I should post this. TIA. Phil. |
#2
|
|||
|
|||
Hi CAD,
I really don't know where to begin asking this, but if there is a better NG than this one, I'd apprieciate your direction on where I should post this. The best place to pursue this would be a word.vba newsgroup, such as word.vba.general. Don't forget to mention the version of Word. Is there a way to have a VBA routine go through, and identify (which would be embedded in the VBA routine) keywords, and then based on that keyword, trigger a "copy" to action? There is always a consistent keyword preceding the desired data value. The first example, yes. The FIND functionality would get you to the keyword, then you need to move across to the next word, in the braces to pick up the data. The second example, where one thing is under(?!) the other will be much more tricky. But if the number of tabs between items is consistent, not too terrible. If the number of tabs is NOT consistent, then it should still be doable, but not "fun". For example, here is a typical sentance (with the desired data value in {}, and the keyword in caps: EXAMPLE 1) That certain tract of land CONTAINING {105.899}acres, more or less... EXAMPLE 2) or another example in tabular format, separated by tabs (but shown here with commas and no separation); 1st line: *Surface,Mineral,Net 2nd line: Owner,*Interest,Interest,Mineral Acres 3rd line: John H. Smith,100%,50%,52.9495 * TO CLARIFY: The words Surface and Interest go together (like Surface Interest), just one on top of each other. Same for the words Mineral and Interest, as well as Net and Mineral Acres. Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004) http://www.word.mvps.org This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-) |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Please give us REVEAL CODES like WORD PERFECT not reveal codes in. | Microsoft Word Help | |||
formatting numeric data from Access merged into a Word table | Mailmerge | |||
Envelope Address | New Users | |||
1st word in heading flush left second word flush right | New Users | |||
How do I create & merge specific data base & master documents? | New Users |