views:

11

answers:

0

I opened a Word Doc,which had tables in it, use VBA from access. I want to add a new line and write something in that line. I worte some code but that code worked only in debug mode. As soon as i clear all break point and let the programm run, i will have a problem. It seems that word will only write data into the first line. Please help。

 for j = 0 to 5

   oDoc.tables(1).rows.Add 
   for k=0 to 5
   oDoc.tables(1).cell(oDoc.tables(1).rows.count,k+1)=myarray(k)
   next k

   do something to myarray 
next j