Sub 删除重复段落方案二DeleteDuplicateParagraphs()Set d = CreateObject('Scripting.Dictionary') Dim p As Paragraph Dim t As Variant Dim i AsInteger Dim StartTime As Single StartTime = Timer ' collect duplicates 收集重复项 For Each p In ActiveDocument.Paragraphs t = p.Range.Text If t <> vbCr Then If Not d.Exists(t) Then d.Add t, CreateObject('Scripting.Dictionary') d(t).Add d(t).Count + 1, p End If Next ' eliminate duplicates 删除重复项Application.ScreenUpdating = FalseForEach t In dFor i = 2To d(t).Count d(t)(i).Range.DeleteNextNext Application.ScreenUpdating = True MsgBox 'This code ran successfully in ' & Round(Timer - StartTime, 2) & ' seconds', vbInformationEnd Sub