> Hi!
> I split a table into a lot of pages using macro and I would like to
[quoted text clipped - 7 lines]
> docWord.Tables(2).Rows(1).Range.Select
> Selection.Paste 'Gives error 438..
Try something like this:
Dim tblPaste As Table
Dim i As Long
Dim rowCopy As Row
With ActiveDocument
Set rowCopy = .Tables(1).Rows(1)
For i = 2 To .Tables.Count
With .Tables(i)
.Rows.Add (.Rows(1))
.Rows(1).Range.FormattedText = rowCopy.Range.FormattedText
.Rows(2).Delete
End With
Next
End With
Alex St-Pierre - 18 Mar 2008 16:14 GMT
Thank's a lot. It works very well.
I'm wondering if there are 2 rows to copy from table #1 to table #2 (first
two row), is it possible to copy the 2 rows at the same time by setting
rowCopy equal to the first two rows?
Alex

Signature
Alex St-Pierre
> > Hi!
> > I split a table into a lot of pages using macro and I would like to
[quoted text clipped - 24 lines]
> Next
> End With
Jean-Guy Marcil - 18 Mar 2008 17:29 GMT
> Thank's a lot. It works very well.
> I'm wondering if there are 2 rows to copy from table #1 to table #2 (first
> two row), is it possible to copy the 2 rows at the same time by setting
> rowCopy equal to the first two rows?
Modify the code I posted and try it! You would probably need two row
objects... Or try without row objects and use the Range object instead...