Inserting rows into tables 
Author Message
 Inserting rows into tables

This may sound like a silly one, but I am trying to insert rows into a
table. However, I want the row to appear at the bootm of the table, not in
the middle.
I am not actually calling this from Word, but from Delphi, but I am using
VBA to do it.

The code I am using is basically this:

Set myVar = ActiveDocument.Tables(1).Rows.Last
ActiveDocument.Tables(1).Rows.Add(BeforeRow:=myVar)

However, this inserts a row before the last row. All I want is some way of
telling it to stick it at the end instead, in effect ignoring the before row
command.

Can anyone tell me how to do this?

Thanks

Simon Keefe



Sun, 12 May 2002 03:00:00 GMT  
 Inserting rows into tables
Hi Simon,

ActiveDocument.Tables(1).Rows.Add

will add a row to the bottom of the first table in the document.  Too simple
eh?

Hope this helps,
Doug Robbins - Word MVP
Please post any follow-up to the Newsgroups so that others may benefit
therefrom or contribute thereto.

Quote:
> This may sound like a silly one, but I am trying to insert rows into a
> table. However, I want the row to appear at the bootm of the table, not in
> the middle.
> I am not actually calling this from Word, but from Delphi, but I am using
> VBA to do it.

> The code I am using is basically this:

> Set myVar = ActiveDocument.Tables(1).Rows.Last
> ActiveDocument.Tables(1).Rows.Add(BeforeRow:=myVar)

> However, this inserts a row before the last row. All I want is some way of
> telling it to stick it at the end instead, in effect ignoring the before
row
> command.

> Can anyone tell me how to do this?

> Thanks

> Simon Keefe



Sun, 12 May 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Inserted rows in table not alined

2. Db Grid cannot insert rows when table is empty

3. Insert row in table using VBA

4. table row text will not show after row insert

5. Insert new row at the end of the table

6. WordBasic/VBA to insert table rows in Word 97

7. how to insert many rows in one table efficiently

8. ADO.NET DataSet.TableName.AddTableNameRow() inserts an extra row

9. insert row from row

10. adding a table row, without setting same defaults as previous row

11. row heights of table rows added by vba

12. Err No rows at, duplicate table and row names

 

 
Powered by phpBB® Forum Software