|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
楼主,大纲级别并不能改变标题级别,必须用“wdstyleheading3”或"标题 3"来设置它的标题级别,大纲级别才会改变;另外,自动排版是个系统工程,在排版标题之前要做一些初始化工作。
- Sub 标题三()
- Dim t As Table
- With ActiveDocument
- .Content.Find.Execute "[^13^l]", , , 1, , , , , , "^p", 2
- For Each t In .Tables
- With t.Range.Rows
- .WrapAroundText = False
- .Alignment = wdAlignRowCenter
- End With
- Next
- .Select
- End With
- CommandBars.FindControl(ID:=122).Execute
- CommandBars.FindControl(ID:=123).Execute
-
- With Selection.ParagraphFormat
- .CharacterUnitFirstLineIndent = 0
- .FirstLineIndent = CentimetersToPoints(0)
- End With
-
- Dim i As Paragraph
- For Each i In ActiveDocument.Paragraphs
- With i.Range
- If .Text Like "[一二三四五六七八九十]、*" Or _
- .Text Like "[一二三四五六七八九十][一二三四五六七八九十]、*" Or _
- .Text Like "[一二三四五六七八九十]十[一二三四五六七八九十]、*" Then
- .Style = wdStyleHeading3
- With .ParagraphFormat
- .LeftIndent = CentimetersToPoints(0.09)
- .RightIndent = CentimetersToPoints(0.18)
- .SpaceBefore = 17.5
- .SpaceBeforeAuto = False
- .SpaceAfter = 22.5
- .SpaceAfterAuto = False
- .LineSpacingRule = wdLineSpaceMultiple
- .LineSpacing = LinesToPoints(2.25)
- .Alignment = wdAlignParagraphLeft
- .FirstLineIndent = CentimetersToPoints(0.44)
- ' .OutlineLevel = wdOutlineLevel3
- .CharacterUnitLeftIndent = 0.5
- .CharacterUnitRightIndent = 1
- .CharacterUnitFirstLineIndent = 2.5
- .LineUnitBefore = 3.5
- .LineUnitAfter = 4.5
- End With
- End If
- End With
- Next
- End Sub
复制代码 |
|