|
Sub 表格跨页()
Dim i As Integer, p1 As Long, pn As Long
For i = 1 To ActiveDocument.Tables.Count Step 1
ActiveDocument.Tables(i).Cell(1, 1).Select
Selection.Information(wdActiveEndPageNumber) = p1
ActiveDocument.Tables(i).Cell(Tables(i).Rows.Count, 1).Select
Selection.Information(wdActiveEndPageNumber) = pn
If pn <> p1 Then
Tables(i).Rows(1).Cells(1).Select
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.HomeKey Unit:=wdLine
Selection.InsertBreak Type:=wdPageBreak
End If
Next
End Sub
但是代码显示“子过程或函数未定义”,请问如何改进?谢谢。
|
|