I have a macro which searches for a paragraph break ("^p") in a selection of text. I notice that, in the Advanced Find & Replace Screen, word tells you how many instances of the search item has been found. How do I extract this count?
I have recorded a VBA macro which does the find in a selection, but I don't know how to extract the number of occurrences from that selection. Does anyone know how to do this (would prefer to just extract it from the find&replace function as opposed to writing a for-loop)?
Selection.Find.ClearFormatting
With Selection.Find
.Text = "^p"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With