J
Jesper F
I need to insert a table in a word document, that I'm opening up with
late binding.
Currently I simply loop through the Access recordset and create a text
chunk with the fields-to-be seperated by semicolons. (iCount is the
row count and iFieldsCount is the column count).
I then use:
oword.Selection.MoveDown Unit:=WD_Line, Count:=iCount + 1,
Extend:=WD_Extend
oword.Selection.ConvertToTable Separator:=WD_SeparateByCommas,
NumColumns:=iFieldsCount, NumRows:=iCount,
AutoFitBehavior:=WD_AutoFitContent
to select the text chunk and convert it to a table.
(oword is my word object).
However this fails sometimes because I don't know the length of the
text chunk and thus don't know how much text to select before
attempting to convert it to a table.
Can I instead create a table and start in cell no. 1 and walk through
that table and simultaniously walk through the recordset and insert
values in the cells?
Many thanks.
late binding.
Currently I simply loop through the Access recordset and create a text
chunk with the fields-to-be seperated by semicolons. (iCount is the
row count and iFieldsCount is the column count).
I then use:
oword.Selection.MoveDown Unit:=WD_Line, Count:=iCount + 1,
Extend:=WD_Extend
oword.Selection.ConvertToTable Separator:=WD_SeparateByCommas,
NumColumns:=iFieldsCount, NumRows:=iCount,
AutoFitBehavior:=WD_AutoFitContent
to select the text chunk and convert it to a table.
(oword is my word object).
However this fails sometimes because I don't know the length of the
text chunk and thus don't know how much text to select before
attempting to convert it to a table.
Can I instead create a table and start in cell no. 1 and walk through
that table and simultaniously walk through the recordset and insert
values in the cells?
Many thanks.