Hello everyone,
Could some kind soul please offer me some starting code for the above?
I'd be in Access.
I'd be using a document variable such as WordDoc
I do a mail merge then have a document sitting there and now they want a
Schedule in table form at the end.
So what i'm looking to do is to add a table with probably a set number of
columns, say 4 or 5, and then start to fill out the table with data from
the database.
So i'd need to see how to create the table at the end of the document and
then how to access the fields so that I could insert the appropriate data.
oh yes, would only know the number of rows required after running query.
Thank you for reading...
Jezebel - 06 Sep 2006 06:33 GMT
Something along these lines --
Dim pTable as Word.Table
Dim pIndex as long
With WordDoc
pIndex = .Range.end - 1
set pTable = .Tables.Add Range:=.Range(pIndex ,pIndex ), NumRows :=
RS.RecordCount, NumColumns:=4
End With
for pIndex = 1 to RS.RecordCount
pTable.Cells(pIndex,1) = pRS(1)
pTable.Cells(pIndex,2) = pRS(2)
:
Next
> Hello everyone,
>
[quoted text clipped - 16 lines]
>
> Thank you for reading...
Peter Jamieson - 06 Sep 2006 11:28 GMT
You can always consider doing it using a DATABASE field in the document.
However, you have little control over the layout and Word is also capable of
getting rather confused between the DATABSE's data source and the mail
merge's data source.
Peter Jamieson
> Hello everyone,
>
[quoted text clipped - 16 lines]
>
> Thank you for reading...