From: Graham Mayor on
Excellent!. Can you post the code you used to send it to your Access table?
You could send it to the link on the home page of my web site. I am
interested to learn what you did.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


"s" <s(a)mailinator.com> wrote in message
news:124a11d1-85ca-4cb0-992b-5f6dd1401c8d(a)f13g2000vbm.googlegroups.com...
Thanks, yes I replaced it with commands to send content to Access
table and it worked fine.

Thanks again.

On Jun 1, 12:42 am, "Graham Mayor" <gma...(a)REMOVETHISmvps.org> wrote:
> What you are missing is that the message box is only to illustrate that
> the
> macro works. As suggested earlier *replace* the message box with the
> commands to send the content to your Access table. It's the Access
> programming I am unfamiliar with.
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web sitewww.gmayor.com
> Word MVP web sitehttp://word.mvps.org


From: s on
On Jun 2, 1:28 am, "Graham Mayor" <gma...(a)REMOVETHISmvps.org> wrote:
> Excellent!. Can you post the code you used to send it to your Access table?
> You could send it to the link on the home page of my web site. I am
> interested to learn what you did.
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor -  Word MVP
>
> My web sitewww.gmayor.com
> Word MVP web sitehttp://word.mvps.org

The code is below. Whatever I added to send data
to Access has a comment New Addition.

Option Explicit

Sub ReturnTableText()

Dim oTable As Table
Dim oRow As Row
Dim oRng As Range
Dim sText As String
Dim count As Integer
Dim dbMyDB As DAO.Database
Dim myRecordSet As DAO.Recordset


Set dbMyDB = DBEngine.Workspaces(0).OpenDatabase("C:
\mydatabase.accdb") ' New Addition
Set myRecordSet = dbMyDB.OpenRecordset("Table1", dbOpenDynaset) ' New
Addition

sText = ""
count = 1

myRecordSet.AddNew ' New Addition
For Each oTable In ActiveDocument.Tables

For Each oRow In oTable.Rows

If oRow.Cells.count > 1 Then
Set oRng = oRow.Cells(oRow.Cells.count).Range
oRng.End = oRng.End - 1


myRecordSet.Fields(count).Value = oRng.Text ' New Addition


count = count + 1

End If

Next oRow

Next oTable
myRecordSet.Update ' New Addition


myRecordSet.Close ' New Addition
dbMyDB.Close ' New Addition

End Sub


> > Graham Mayor - Word MVP
>
> > My web sitewww.gmayor.com
> > Word MVP web sitehttp://word.mvps.org

From: Graham Mayor on
Thanks :) I'll have a play around with that tomorrow.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


"s" <s(a)mailinator.com> wrote in message
news:437d82a7-16a9-410a-a12e-05f9c43ef1c1(a)w3g2000vbd.googlegroups.com...
On Jun 2, 1:28 am, "Graham Mayor" <gma...(a)REMOVETHISmvps.org> wrote:
> Excellent!. Can you post the code you used to send it to your Access
> table?
> You could send it to the link on the home page of my web site. I am
> interested to learn what you did.
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web sitewww.gmayor.com
> Word MVP web sitehttp://word.mvps.org

The code is below. Whatever I added to send data
to Access has a comment New Addition.

Option Explicit

Sub ReturnTableText()

Dim oTable As Table
Dim oRow As Row
Dim oRng As Range
Dim sText As String
Dim count As Integer
Dim dbMyDB As DAO.Database
Dim myRecordSet As DAO.Recordset


Set dbMyDB = DBEngine.Workspaces(0).OpenDatabase("C:
\mydatabase.accdb") ' New Addition
Set myRecordSet = dbMyDB.OpenRecordset("Table1", dbOpenDynaset) ' New
Addition

sText = ""
count = 1

myRecordSet.AddNew ' New Addition
For Each oTable In ActiveDocument.Tables

For Each oRow In oTable.Rows

If oRow.Cells.count > 1 Then
Set oRng = oRow.Cells(oRow.Cells.count).Range
oRng.End = oRng.End - 1


myRecordSet.Fields(count).Value = oRng.Text ' New Addition


count = count + 1

End If

Next oRow

Next oTable
myRecordSet.Update ' New Addition


myRecordSet.Close ' New Addition
dbMyDB.Close ' New Addition

End Sub


> > Graham Mayor - Word MVP
>
> > My web sitewww.gmayor.com
> > Word MVP web sitehttp://word.mvps.org