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.Do***ent
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 = ThisDo***ent.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.do***ents.Open "C:\AddressList.doc"
Set docWord = appWord.ActiveDo***ent
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.ActiveDo***ent.Close
Set rsAddr = Nothing
Set docWord = Nothing
appWord.Quit
Set appWord = Nothing
DoCmd.Hourglass False
Me.lblProcessing.Visible = False
Me.Repaint
End Sub


|