|
* 楼主,请将代码复制后粘贴到空白文档中,全选,复制,再粘贴到 VBE 中,以防乱码。
* 不想要的格式之代码行可删除或屏蔽注释之。
- Sub a0813_TableSplit_DeleteBlankLines()
- '表格拆分/删除空行
- Dim doc As Document, r As Row, t As Table
- Set doc = ActiveDocument
- '整表行高
- With doc.Tables(1).Rows
- .HeightRule = wdRowHeightAtLeast
- .Height = CentimetersToPoints(0.9)
- End With
- '删除空行
- For Each r In doc.Tables(1).Rows
- If Len(Replace(Replace(r.Range, vbCr, ""), Chr(7), "")) = 0 Then r.Delete
- Next
- '表格拆分
- For Each r In doc.Tables(1).Rows
- With r.Range
- If r.Range Like "表*分析表*" Then
- With .Font
- .NameFarEast = "黑体"
- .NameAscii = "Times New Roman"
- .Size = 16
- .ColorIndex = wdRed
- End With
- r.Height = CentimetersToPoints(1.5)
- r.Select
- Selection.SplitTable
- Selection.InsertBreak Type:=wdPageBreak
- End If
- End With
- Next
- '删除首表前字符
- With doc.Range(0, doc.Tables(1).Range.Start)
- .Select
- Selection.MoveEnd 4, -1
- Selection.Delete
- End With
- '循环遍历所有表格
- For Each t In doc.Tables
- '每表末行加粗
- With t.Rows.Last.Range.Font
- .Bold = True
- .ColorIndex = wdPink
- End With
- '表末插入文字并缩进
- doc.Range(t.Range.End, t.Range.End).InsertAfter Text:=vbCr & vbCr & "投标人签字盖章:" & vbCr & vbCr & "日期:"
- With doc.Range(t.Range.End, t.Range.End).Next(4, 1)
- .Next(4, 1).ParagraphFormat.CharacterUnitFirstLineIndent = 14.5
- .Next(4, 1).Next(4, 1).Next(4, 1).ParagraphFormat.CharacterUnitFirstLineIndent = 19.5
- End With
- Next
-
- MsgBox "处理完毕!", 0 + 48
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|