Imoorting a word document?

J

jessica

I work for a small magazine company and previously we have listed all of our
subscribers and members in a word document and printed our labels from there
but recently my boss has asked me to learn how to use access and organize our
subscribers in there. She also wants me to re-enter the 2,000 names and
address's we have in word into access since there seems to be no other way.
So my questions is, is there an easier to way to get all these names into
Access as oppose to re-entering 2,00o names and address's?
 
R

Roger Lord

Jessica,

I don't know how the data is organized in Word, but if it could
be converted into an Excel spreadsheet, things would be a lot
easier since Access has an Excel import that is very easy to use.

You only hint that you are using Word's mail merge feature for
making labels. If you are, there's usually a Word table or an
Excel spreadsheet behind the mail merge output. If this is so,
importing from that table (or spreadsheet) would significantly
simplify the job.

Maybe if you provided a few more details about your Word data,
more help could be provided. Re-entering 2000 names & addresses
seems more painful than volunteering for unnecessary root canal
work without novocain.

Sincerely,
Roger

----------------------------------------

I work for a small magazine company and previously we have listed
all of our
subscribers and members in a word document and printed our labels
from there
but recently my boss has asked me to learn how to use access and
organize our
subscribers in there. She also wants me to re-enter the 2,000
names and
address's we have in word into access since there seems to be no
other way.
So my questions is, is there an easier to way to get all these
names into
Access as oppose to re-entering 2,00o names and address's?
 
P

Pete D.

Using VBA it may be possible to use the pattern of data to parse the data
into access. Don't let VBA scare you. As you do a mail merge there is
hope. Post a few records from word here so others can see how your data is
organized. If the address are in a word address table tell us. We need to
know how your data is orginized. Pete
 
P

pietlinden

Here's my attempt at it... I'm close... I just need the end of line
delimiter from the Word table so I can split the lines...

Option Compare Database
Option Explicit

Private Sub Command0_Click()
Dim appWord As Word.Application
Dim docWord As Word.Document
Dim iCounter As Integer
Dim iRow As Integer, iColumn As Integer
Dim oRng As Range
Dim strContents As String
Dim rsAddr As DAO.Recordset


'Set oRng = ThisDocument.Tables(1).Cell(1, 1).Range
'oRng.MoveEnd Unit:=wdCharacter, Count:=-1
Me.lblProcessing.Visible = True
Me.Repaint
DoCmd.Hourglass True

Set appWord = New Word.Application
appWord.documents.Open "C:\AddressList.doc"
Set docWord = appWord.ActiveDocument

Set rsAddr = DBEngine(0)(0).OpenRecordset("Addressbook",
dbOpenTable, dbAppendOnly)

'process individual cells in the table.
For iRow = 1 To docWord.Tables(1).Rows.Count
For iColumn = 1 To docWord.Tables(1).Columns.Count
Set oRng = docWord.Tables(1).Cell(iRow, iColumn).Range
oRng.MoveEnd unit:=wdCharacter, Count:=-1

strContents = Trim(oRng.Text)

If Len(strContents) > 1 Then
'splitting would be here.
rsAddr.AddNew
rsAddr.Fields("Address") = strContents
rsAddr.Update
End If
Next iColumn
Next iRow

rsAddr.Close
appWord.ActiveDocument.Close

Set rsAddr = Nothing
Set docWord = Nothing
appWord.Quit
Set appWord = Nothing

DoCmd.Hourglass False
Me.lblProcessing.Visible = False
Me.Repaint
End Sub
 

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