Import Word table document into Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a Word table document (700 pgs) with 6 columns, the info in each
column is straight text, no form field, no drop down, etc.. What is the best
way to import this table document into Access so I can continue to add new
information.

Thank you in advance for your time.
 
Hi Dorna,

First, make sure that there are no merged cells anywhere in the table.

Things could get complicated if there are any paragraph marks, line
breaks, tabs etc. in the data. If there aren't, make a spare copy of the
document, delete everything except the table, convert the table to text,
save the result as a plain text file, and try importing that into
Access. (If there is in fact more than one table in the document - and
700 pages is *big* for a Word table - you can convert them all to text
and remove any material between them.)

Otherwise, you could try this:
-Save the document in HTML format, and try importing the table from
there.

Or this:
-Use Word's Replace function to replace all paragraph marks, line breaks
and tabs in the table with combinations of ordinary characters that
don't appear in the data (e.g. <** for a paragraph mark)
-Proceed as above to get the data into Access
-Use update queries to replace your paragraph mark and line feed symbols
with Chr(13) & Chr(10), and tabs with Chr(0) - bearing in mind that
Access textboxes don't know about tab stops.

If none of these work, it's always possible to use Automation to read
the table cell by cell directly from Word and create records in Access.
 
John,

Changing the Word document to html worked and I was able to import into
Access. I do have one more question. I noticed after importing, some of the
text in the fields is missing a space between the words. For example,
"Further specific information..." looks like "Furtherspecific information..."

I checked the Word document and the html document and the space between the
words are there. Somehow during importing, it strips the space between the
words. Any ideas?
 
Hi Donna,

I haven't heard of this one.

One thing I'd try would be to look at the HTML code (using FrontPage if
you have it, otherwise open the HTML file using Notepad or another text
editor), and locate places where a space is going missing.

You may find some common factor there: for instance do they all occur at
the end of a line in the HTML code, or where there's a combination of
HTML tags. If so, experiment with adding additional spaces in the HTML
and see if that imports better.

If that fails, try inserting
&nbsp;
into the HTML where you need a space. (Conversely, if you find "&nbsp;"
in the HTML code where a space is going missing, add a space to the HTML
file before or after the "&nbsp;".)
 
Dear John,

I looked at the html document using FrontPage, and did find the common
factor of the missing space I saw in Access was appearing at the end of a
line in the html document. I typed in the space code at three locations (for
a test) within the html document and reimported the html document into
Access. It did solve the problem.

However, my Word document is 700 pgs. How do I insert the "space code" at
the end of a line in the html document for every line automatically?

Dorna
 
Hi Dorna,

For myself, I'd do this by using Perl from the windows command line.
This command will add a space to any line that doesn't already end with
one:

perl -ibak -wlpe "s/(\S)$/$1 /" myfile.html

If you don't have Perl installed on your computer you should be able to
achieve the same thing using FrontPage's Replace feature on a copy of
your HTML file. Check the Regular Expressions box, and put this in Find
What:
{[^ ]}$
and this (<space> means a space character) in Replace With:
\1<space>
before doing Replace All.
 
Back
Top