How do I import many names & addresses in a Letter to a Word Data

P

Pugh

I have many names & addresses in a Word Letter that I would like to
automatically import that information into a Word Data. Can anyone please
help me?
 
J

Jerry Whittle

This is the wrong forum for a Word to Word question. Now if you'd like to put
it into an Access database....
 
P

Pendragon

Jerry,

I have the same situation, but yes, I would like to bring it into an Access
table.

My Word document, which I have been asked to import into a database,
thankfully has consistent field names, but it's essentially in column layout.
That is, if I convert text to table in Word, column 1 is field names, column
2 is data. All fields names have a colon after them, so it is easy to
separate the field name from the corresponding data.

Something like this:

Type: Individual
ContactFirstName: John
ContactMI: <blank>
ContactLastName: Smith
etc.
....
<CR>

and so on with the next record

I was hoping there might be an easy way to grab this data without having to
write a string search procedure to append the data one field at a time into a
recordset.

I would be interested to hear what your suggestion is. Thanks!
 
J

Jerry Whittle

Convert the table to text. Then save the file as a Text document and ignore
all the warnings. If the data is as clean as you say, you should be able to
import the text file into Access by going to File, Get External Data, Import
and follow the prompts for text files.
 
P

Pendragon

The issue is that the information is vertical, not horizontal. If I import
the file, one record is 20 rows, instead of 1 row with 20 fields. I can go
through the hassle of writing code to translate the table row by row, but I
was just looking for a simpler method.
 
J

John Nurick

Type: Individual
ContactFirstName: John
ContactMI: <blank>
ContactLastName: Smith
etc.
...
<CR>

There are some scripts on my website for handling this sort of thing.

It sounds as if you can get the data into a Word table with field names
in one column and values in the other. If so, and if every record
contains the same fields in the same order, delete the fieldnames column
and export just the data into a text file, e.g.

Individual
John
<blank line>
Smith
...
<blank line between records>
Individual
Mary
P
Evans
...

you can use this VBScript to convert it to a tab-delimited file that
Access can easily import.
http://www.j.nurick.dial.pipex.com/Code/VBS/TallToWide.vbs

Alternatively, if you have or can install Perl on your computer, there
are a couple of scripts for converting files of Name: Value pairs into
delimited files on this page:
http://www.j.nurick.dial.pipex.com/Code/Perl/index.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top