Reply
 
Thread Tools Display Modes
  #1   Report Post  
CAD Fiend
 
Posts: n/a
Default 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   Report Post  
Cindy M -WordMVP-
 
Posts: n/a
Default

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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Please give us REVEAL CODES like WORD PERFECT not reveal codes in. Rachel King Microsoft Word Help 38 August 21st 09 09:54 PM
formatting numeric data from Access merged into a Word table LacieMoon Mailmerge 11 December 5th 06 10:12 PM
Envelope Address GR New Users 5 April 24th 05 09:48 PM
1st word in heading flush left second word flush right Elin New Users 9 April 4th 05 08:44 PM
How do I create & merge specific data base & master documents? maggiev New Users 2 January 12th 05 11:30 PM


All times are GMT +1. The time now is 10:27 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"