描述:
如
Selection的MOVE方法,SetRange方法,得到了一个range,range里有张表A,有I行,J列,然后怎么新建一个Selection并用Selection.InsertRows()方法在表A的最后插入N行,使A变成I+N行,J列呢,谢谢
解决方案1:
Word::Selection aSel(m_WordApplication.GetSelection());
range.GetSelect();
VARIANT insertRows;
insertRows.vt=VT_I4;
insertRows.lVal = N;
aSel.InsertRowsBelow(&insertRows);
Sub InsertRowsByRows()
Dim oTable As Table
Set oTable = ThisDocument.Tables(1)
For i = 0 To 3
oTable.Rows.Add (oTable.Rows.Last)
Next
End Sub
Sub InsertRowsBySelection()
Dim oTable As Table
Set oTable = ThisDocument.Tables(1)
oTable.Rows.Last.Select
Selection.InsertRows (4)
End Sub