|
- Sub aaab序号降级1()
- '标题4降级为标题5:1.=>(1)
- With ActiveDocument.Content.Find
- .ClearFormatting
- .Text = "^13[0-9]{1,}[、..]"
- .Forward = True
- .MatchWildcards = True
- Do While .Execute
- With .Parent
- .Characters.Last.Text = ")"
- .Characters.First.InsertAfter Text:="("
- .MoveEnd
- .Font.Color = wdColorPink '粉红(本行代码可删除)
- .Start = .End
- End With
- Loop
- End With
- '标题3降级为标题4:(一)=>1.
- Dim n&
- With ActiveDocument.Content.Find
- .ClearFormatting
- .Text = "^13[((][一二三四五六七八九十百零〇○]{1,}[))]"
- .Forward = True
- .MatchWildcards = True
- Do While .Execute
- n = n + 1
- With .Parent
- .MoveStart
- .Text = n & "."
- .Font.Color = wdColorGreen '绿色(本行代码可删除)
- .Start = .End
- End With
- Loop
- End With
- '标题2降级为标题3:一、=>(一)
- With ActiveDocument.Content.Find
- .ClearFormatting
- .Text = "^13[一二三四五六七八九十百零〇○]{1,}、"
- .Forward = True
- .MatchWildcards = True
- Do While .Execute
- With .Parent
- .Characters.Last.Text = ")"
- .Characters.First.InsertAfter Text:="("
- .MoveEnd
- .Font.Color = wdColorRed '红色(本行代码可删除)
- .Start = .End
- End With
- Loop
- End With
- End Sub
复制代码 |
|