本帖最后由 413191246se 于 2018-12-29 22:25 编辑
- Sub MyStyle()
- Dim i As Paragraph, j&, a, b
- For Each i In ActiveDocument.Paragraphs
- With i.Range
- If .Text Like "[一二三四五六七八九十]、*" Then
- .Style = "样式 1"
- ElseIf .Text Like "#.*" Or .Text Like "##.*" Then
- .Style = "样式 2"
- ElseIf .Text Like "(#)*" Or .Text Like "(##)*" Then
- .Style = "样式 3"
- End If
- End With
- Next
- a = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
- b = Array("①", "②", "③", "④", "⑤", "⑥", "⑦", "⑧", "⑨", "⑩")
- With ActiveDocument.Content.Find
- For j = 0 To 9
- .Execute a(j) & ".", , , , , , , , , b(j), 2
- Next j
- End With
- End Sub
复制代码 |