参考下面的: Sub 表格统一样式() '读取第一个表格 Dim atable As Table Dim i%, awidth, aheight Dim i1% Dim aleftrow Application.ScreenUpdating = False Set atable = ActiveDocument.Tables(1) ReDim awidth(1 To atable.Range.Cells.Count) ReDim aheight(1 To atable.Range.Cells.Count) With atable.Range aleftrow = .Rows.LeftIndent '左缩进 '读进数组 For i = 1 To .Cells.Count awidth(i) = .Cells(i).Width aheight(i) = .Cells(i).Height Next End With '把数组的值依次读到Word的表格中,当然,从第二个表格算起 For i = 2 To ActiveDocument.Tables.Count With ActiveDocument.Tables(i).Range .Rows.LeftIndent = aleftrow For i1 = 1 To .Cells.Count .Cells(i1).Width = awidth(i1) .Cells(i1).Height = aheight(i1) Next End With Next Application.ScreenUpdating = True End Sub
|