|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
楼主,你不必分散对齐,在 合并结果 文档中,请试试我下面的宏,看有没有效果:(光标在表格中,只处理光标所在表格;否则,处理所有表格)
- Sub 表格缩行()
- Dim t As Table, c As Cell, i&
- With Selection
- If .Information(wdWithInTable) = True Then i = 1
- For Each t In ActiveDocument.Tables
- If i = 1 Then Set t = .Tables(1)
- With t.Range.Find
- .Execute "^l", , , 0, , , , , , "", 2
- .Execute "^13", , , 0, , , , , , "", 2
- End With
- For Each c In t.Range.Cells
- c.Range.Select
- .MoveEnd unit:=wdCharacter, Count:=-1
- If .Font.Spacing = "9999999" Then .Font.Spacing = 0
- If .Font.Scaling = "9999999" Then .Font.Scaling = 100
- If .Range.ComputeStatistics(statistic:=wdStatisticLines) > 1 Then .Font.Spacing = -0.5
- Do Until .Range.ComputeStatistics(statistic:=wdStatisticLines) = 1
- If .Range.ComputeStatistics(statistic:=wdStatisticLines) = 0 Then Exit Do
- .Font.Scaling = .Font.Scaling - 2
- Loop
- Next
- If i = 1 Then Exit For
- Next
- End With
- End Sub
复制代码
|
|