Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Tables In Ms Word

i am using the following code to make a table from a flex grid. ive changed the range values to accomdate the current number of characters, however, one of the fields is "invoice number" this is to be displayed before the table, but if the number changes from 2 numbers long to 3 numbers long, then the table wont be in the correct place.
is there a way to set a line that the table starts on instead of telling it where to start with Range?
is there a way to set the range as the count up to a certain point?

here is the code im using.

Set wrdRange = wrdDoc.Range(Start:=100, End:=100)
r = flxItems.Rows
c = flxItems.Cols
Set wrdTbl = wrdDoc.Tables.Add(wrdRange, r, c)


If flxItems.Rows = 0 Or flxItems.Rows = 1 Then Exit Sub
r = flxItems.Rows
c = flxItems.Cols
With flxItems
For r = 1 To .Rows
For c = 1 To .Cols
wrdTbl.Cell(r, c).Range.Text = .TextMatrix(r - 1, c - 1)
Next c
Next r
End With
[1097 byte] By [skalra63] at [2007-11-11 8:26:35]