答案 0 :(得分:1)
解决方案如下。它计算出现次数,然后循环删除短语和段落标记的文本:
Sub DeleteReplyComments()
' loop through lines to count Replies
Selection.Find.ClearFormatting
MyDoc = ActiveDocument.Range.Text
txt = "Reply to this comment"
t = Replace(MyDoc, txt, "")
nCount = (Len(MyDoc) - Len(t)) / Len(txt)
' delete Replies and ^p's
For i = 1 To nCount
With Selection.Find
.Text = "Reply to this comment"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveEnd Unit:=wdParagraph
Selection.Delete Unit:=wdCharacter, Count:=1
Next i
End Sub