* 楼主,我重新编写了程序,没有多余的步骤,仅对你的示例文档有效,请试用:
- Sub Chinese_English_View_20210124()
- Dim i As Paragraph, r As Range, s As Range, n&, j&
- With ActiveDocument
- .ConvertNumbersToText
- .Content.Find.Execute "[^13^l]", , , 1, , , , , , "^p", 2
- For Each i In .Paragraphs
- If Len(i.Range) = 1 Then i.Range.Delete
- Next
- End With
- With Selection
- .HomeKey 6
- Do
- .MoveEnd 4
- Loop Until Asc(.Next) < 0
- Set r = .Range
- j = .Paragraphs.Count
- .MoveRight
- .EndKey 6, 1
- Set s = .Range
- Do
- n = n + 1
- r.Paragraphs(n).Range.Characters.Last.InsertBefore Text:="`" & Replace(s.Paragraphs(n).Range.Text, vbCr, "")
- Loop Until n = j
- s.Delete
- .HomeKey 6
- End With
- ActiveDocument.Content.Find.Execute "`", , , 0, , , , , , "^p", 2
- End Sub
复制代码 |