使用 ActiveDocument 时记录替换量

Recording the amount of replacements when using ActiveDocument

我需要在状态栏中显示这个词宏的替换量。我不确定如何以整数形式进行替换。

With ActiveDocument.Range.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = xSelection
    .Replacement.Text = myValue
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchWildcards = True
    .Execute Replace:=wdReplaceAll
End With

wbReplaceAll查找不return替换计数。 你必须自己计算。其中一种方法可以 see there