woor表格跨页断行的意思是指word表格中的某行内容可以一部分在一个页面,另一部分在另一个页面。
如果不允许跨页断行,则如果该表格的某行内容特别长,则会全部出现在下一个页面。
在vba中可以一次设置所有的行都允许跨页断行,也可以单独设置某个行允许跨页断行。
代码如下:
Sub exceloffice()
'作者QQ:1722187970,微信:xycgenius,微信公众号exceloffice
Dim oDoc As Document
Set oDoc = Word.ActiveDocument
Dim oT As Table
Dim oRow As Row
Dim oColumn As Column
With oDoc
Set oT = .Tables(1)
With oT
'单独设置某一行允许跨页断行
.Rows(3).AllowBreakAcrossPages = True
'一次性设置所有行允许跨页断行
.Rows.AllowBreakAcrossPages = True
End With
End With
End Sub


发表评论