creating one column table with multiple num. of rows problem using word object

  • Thread starter sheilaa via OfficeKB.com
  • Start date
S

sheilaa via OfficeKB.com

below is one partial of my coding. i need to populate date from the
database with only one table, one column but with multiple number of rows..
so the output can look something like this:

id : bla bla
name : bla bla
age : bla bla


i don't know what's wrong with my coding until my computer freeze whenever
i tried to execute these codes..
please help!


..Application.ActiveDocument.Tables.Add.Application.ActiveDocument.Range, 7,
2)
..Application.ActiveDocument.Tables(1).Cell(x, y) = rs.Fields(0)
..Application.ActiveDocument.Tables(1).Cell(x + 1, y) = rs.Fields(2)
..Application.ActiveDocument.Tables(1).Cell(x + 2, y) = rs.Fields(3)
..Application.ActiveDocument.Tables(1).Cell(x + 3, y) = rs.Fields(9)
..Application.ActiveDocument.Tables(1).Cell(x + 4, y) = rs.Fields(3)
..Application.ActiveDocument.Tables(1).Cell(x + 5, y) = rs.Fields(4)

rs.MoveNext
x = x + 1
 

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