#1) In this code, is this being done efficiently? Should I go to 3 ParentNodes to locate the table to get the table row count?
builder.MoveToMergeField("mytable") If builder.CurrentParagraph.ParentNode.ParentNode.ParentNode.NodeType = Aspose.Words.NodeType.Table Then Dim table1 As Aspose.Words.Table table1=builder.CurrentParagraph.ParentNode.ParentNode.ParentNode MsgBox(table1.Rows.Count) End If
#2) Next, I wish to add rows to a table, up to an exact amount. If I have a Word table that has 4 rows, I wish to insert the correct number of rows so it has 10. If it has 3 rows, I wish to insert 7 rows, etc… I believe the above code gets me the row count, but how do I then insert rows onto the table. By the way, I just want the rows to take on the properties of the rows already in the table, so I don’t have to set height, width, etc…
Please let me know answers to #1 and #2.